[clang] [Clang][Parse] Diagnose requires expressions with explicit object parameters (PR #88974)

Krystian Stasiowski via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 17 04:59:34 PDT 2024


================
@@ -0,0 +1,4 @@
+// RUN: %clang_cc1 -std=c++23 -fsyntax-only -verify %s
+
+auto x0 = requires (this int) { true; }; // expected-error {{a requires clause cannot have an explicit object parameter}}
+auto x1 = requires (int, this int) { true; }; // expected-error {{a requires clause cannot have an explicit object parameter}}
----------------
sdkrystian wrote:

@cor3ntin sure, but non-type template parameter parsing doesn't use `ParseParameterDeclarationClause` -- it is done in [`ParseNonTypeTemplateParameter`](https://github.com/llvm/llvm-project/blob/main/clang/lib/Parse/ParseTemplate.cpp#L895)

https://github.com/llvm/llvm-project/pull/88974


More information about the cfe-commits mailing list