llvm-project/clang/test/SemaCXX/cxx2b-deducing-this-compat.cpp
Corentin Jabot af4751738d [C++] Implement "Deducing this" (P0847R7)
This patch implements P0847R7 (partially),
CWG2561 and CWG2653.

Reviewed By: aaron.ballman, #clang-language-wg

Differential Revision: https://reviews.llvm.org/D140828
2023-10-02 14:33:02 +02:00

10 lines
335 B
C++

// RUN: %clang_cc1 -fsyntax-only -std=c++20 %s -verify
struct S {
void f(this auto &a); // expected-error {{explicit object parameters are incompatible with C++ standards before C++2b}}
};
void f() {
(void)[](this auto&a){}; // expected-error {{explicit object parameters are incompatible with C++ standards before C++2b}}
}