1// RUN: %clang_cc1 -fsyntax-only -verify %s
2
3int &f();
4
5struct A {
6  void f();
7};
8
9typedef int I;
10
11void g() {
12  __builtin_call_with_static_chain(f(), f) = 42;
13  __builtin_call_with_static_chain(A().f(), f); // expected-error {{first argument to __builtin_call_with_static_chain must be a non-member call expression}}
14  __builtin_call_with_static_chain((42).~I(), f); // expected-error {{first argument to __builtin_call_with_static_chain must not be a pseudo-destructor call}}
15}
16