xref: /llvm-project/clang/test/SemaCXX/cxx2b-deducing-this-compat.cpp (revision af4751738db89a142a8880c782d12d4201b222a8)
1 // RUN: %clang_cc1 -fsyntax-only -std=c++20 %s -verify
2 
3 struct S {
4     void f(this auto &a); // expected-error {{explicit object parameters are incompatible with C++ standards before C++2b}}
5 };
6 
f()7 void f() {
8     (void)[](this auto&a){}; // expected-error {{explicit object parameters are incompatible with C++ standards before C++2b}}
9 }
10