[clang] [Clang] Mark a concept as being invalid if the constraint is invalid (PR #147938)
Corentin Jabot via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 10 04:23:56 PDT 2025
================
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 -fsyntax-only -std=c++20 -verify %s
+
+template <typename T> void foo();
+template <class... Ts>
+concept ConceptA = requires { foo<Ts>(); };
+// expected-error at -1 {{expression contains unexpanded parameter pack 'Ts'}}
+
+template <class>
+concept ConceptB = ConceptA<int>;
+
+template <ConceptB Foo> void bar(Foo);
+
+void test() { bar(1); }
----------------
cor3ntin wrote:
I think we can put that in an existing file, `test/SemaCXX/concept-crash-on-diagnostic.cpp` seems appropriate (in a GH138823 namespace)
https://github.com/llvm/llvm-project/pull/147938
More information about the cfe-commits
mailing list