[clang] [Clang][Sema] Fix an assertion crash when instantiating a nested requirement (PR #213660)
Younan Zhang via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 3 08:34:25 PDT 2026
================
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 -fsyntax-only -std=c++20 -verify %s
+
+struct S {};
+template <typename T> bar C; // expected-error {{unknown type name 'bar'}}
+
+template <typename U> auto foo() {
+ return []<typename T>(
+ T, bool b = requires { C<T>; }) {
+ static_assert(requires { requires C<U>; }); // expected-error {{static assertion failed due to requirement 'requires { requires <<error-expression>>; }'}}
+ return 0;
+ };
+}
+
+auto baz = foo<int>();
+int qux = baz(S{}); // expected-note {{in instantiation of function template specialization 'foo()::(lambda)::operator()<S>' requested here}}
----------------
zyn0217 wrote:
This needs a trailing blank line.
https://github.com/llvm/llvm-project/pull/213660
More information about the cfe-commits
mailing list