[clang] [Clang][Parser] Have the depth of the abbreviated generic lambdas inside a requires clause differ from the surrounding generic lambda (PR #80656)

Shafik Yaghmour via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 7 21:37:13 PST 2024


================
@@ -168,3 +168,30 @@ auto lambda4 = [] requires(sizeof(char) == 1){}; // expected-error {{expected bo
 #if __cplusplus <= 202002L
 // expected-warning at -2{{lambda without a parameter clause is a C++23 extension}}
 #endif
+
+namespace GH78524 {
+
+template <typename T> T Foo;
+
+template <typename T> auto C(Foo<T>);
+
+template <typename T> struct D {
+  decltype(T()(C<T>)) Type;
+};
+
+template <typename T, typename U> D<T> G(T, U) { return {}; }
+
+struct E {};
+
+void F() {
+  G([]<typename T>
+//     ~~~~~~~~~~ T: 0,0
----------------
shafik wrote:

In these context of this PR these comments about depth make sense but for someone coming to this test outside of this context they won't. Can you add more "depth" to the comment :-)

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


More information about the cfe-commits mailing list