We weren't rejecting a concept declared with multiple template
parameter lists.
PR c++/105067
gcc/cp/ChangeLog:
* pt.cc (finish_concept_definition): Check that a concept is
declared with exactly one template parameter list.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/concepts-err4.C: New test.
return error_mark_node;
}
+ if (current_template_depth > 1)
+ {
+ error_at (loc, "concept %qE has multiple template parameter lists", *id);
+ return error_mark_node;
+ }
+
/* Initially build the concept declaration; its type is bool. */
tree decl = build_lang_decl_loc (loc, CONCEPT_DECL, *id, boolean_type_node);
DECL_CONTEXT (decl) = current_scope ();
--- /dev/null
+// PR c++/105067
+// { dg-do compile { target c++20 } }
+
+template<class>
+template<class>
+concept C = true; // { dg-error "parameter list" }