[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / SemaCXX / call-with-static-chain.cpp
blob45fe2ac294725db0e2761b5070dda069fb0f8b55
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 int &f();
5 struct A {
6 void f();
7 };
9 typedef int I;
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}}