Commit a52cdecf by Paolo Carlini Committed by Paolo Carlini

re PR c++/71128 ([concepts] ICE on ill-formed explicit instantiation of a function concept)

/cp
2018-10-08  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/71128
	* pt.c (do_decl_instantiation): Per 12.6.8/5, a concept cannot be
	explicitly instantiated.

/testsuite
2018-10-08  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/71128
	* g++.dg/concepts/pr71128.C: New.

From-SVN: r264914
parent 8656dafa
2018-10-08 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/71128
* pt.c (do_decl_instantiation): Per 12.6.8/5, a concept cannot be
explicitly instantiated.
2018-10-05 David Malcolm <dmalcolm@redhat.com>
PR c++/56856
......
......@@ -23127,6 +23127,14 @@ do_decl_instantiation (tree decl, tree storage)
error ("explicit instantiation of non-template %q#D", decl);
return;
}
else if (DECL_DECLARED_CONCEPT_P (decl))
{
if (VAR_P (decl))
error ("explicit instantiation of variable concept %q#D", decl);
else
error ("explicit instantiation of function concept %q#D", decl);
return;
}
bool var_templ = (DECL_TEMPLATE_INFO (decl)
&& variable_template_p (DECL_TI_TEMPLATE (decl)));
......
2018-10-08 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/71128
* g++.dg/concepts/pr71128.C: New.
2018-10-08 Richard Sandiford <richard.sandiford@arm.com>
PR c/87286
......
// { dg-do compile { target c++14 } }
// { dg-additional-options "-fconcepts" }
template<typename T>
concept bool C() { return true; }
template bool C<int>(); // { dg-error "explicit instantiation of function concept" }
template<typename T>
concept bool D = true;
template bool D<int>; // { dg-error "explicit instantiation of variable concept" }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment