commit c2e6a2a7e163f285891620e64144b45e1418870a
Author: Jason Merrill <jason@redhat.com>
Date: Tue Apr 3 16:40:02 2018 -0400
PR c++/85133 - ICE with missing concept initializer.
* decl.c (cp_finish_decl): If a concept initializer is missing, use
true.
@@ -7010,7 +7010,10 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p,
if (!VAR_P (decl) || type_dependent_p)
/* We can't do anything if the decl has dependent type. */;
else if (!init && is_concept_var (decl))
- error ("variable concept has no initializer");
+ {
+ error ("variable concept has no initializer");
+ init = boolean_true_node;
+ }
else if (init
&& init_const_expr_p
&& TREE_CODE (type) != REFERENCE_TYPE
new file mode 100644
@@ -0,0 +1,8 @@
+// PR c++/85133
+// { dg-additional-options "-std=c++17 -fconcepts" }
+
+template<typename> concept bool C; // { dg-error "no initializer" }
+
+template<C...> struct A {};
+
+A<int> a;