[clang] [Concepts] Avoid substituting into constraints for invalid TemplateDecls (PR #75697)
Younan Zhang via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 17 02:51:51 PDT 2024
================
@@ -227,3 +227,20 @@ struct r6 {};
using r6i = r6<int>;
// expected-error at -1 {{constraints not satisfied for class template 'r6' [with T = int]}}
+
+namespace GH73885 {
+
+template <class> // expected-error {{extraneous}}
+template <class T> requires(T{})
+bool e_v = true;
+
+static_assert(e_v<bool>);
+
+// We do accept the following as an extension. See Sema::MatchTemplateParametersToScopeSpecifier()
+template <> // expected-warning {{extraneous}}
+template <class T> requires(T{true})
+constexpr bool e = true;
----------------
zyn0217 wrote:
https://github.com/llvm/llvm-project/issues/99296
https://github.com/llvm/llvm-project/pull/75697
More information about the cfe-commits
mailing list