xref: /minix3/external/bsd/llvm/dist/clang/test/SemaCXX/call-with-static-chain.cpp (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 
3 int &f();
4 
5 struct A {
6   void f();
7 };
8 
9 typedef int I;
10 
g()11 void 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