===================================================================
@@ -1877,6 +1877,8 @@ struct GTY(()) language_function {
/* In parser.c. */
extern tree cp_literal_operator_id (const char *);
+#define ERROR_AS_NULL(NODE) ((NODE) == error_mark_node ? NULL_TREE : (NODE))
+
/* TRUE if a tree code represents a statement. */
extern bool statement_code_p[MAX_TREE_CODES];
===================================================================
@@ -26120,7 +26120,7 @@ struct auto_hash : default_hash_traits<tree>
inline hashval_t
auto_hash::hash (tree t)
{
- if (tree c = PLACEHOLDER_TYPE_CONSTRAINTS (t))
+ if (tree c = ERROR_AS_NULL (PLACEHOLDER_TYPE_CONSTRAINTS (t)))
/* Matching constrained-type-specifiers denote the same template
parameter, so hash the constraint. */
return hash_placeholder_constraint (c);
@@ -26879,7 +26879,7 @@ do_auto_deduction (tree type, tree init, tree auto
/* Check any placeholder constraints against the deduced type. */
if (flag_concepts && !processing_template_decl)
- if (tree constr = PLACEHOLDER_TYPE_CONSTRAINTS (auto_node))
+ if (tree constr = ERROR_AS_NULL (PLACEHOLDER_TYPE_CONSTRAINTS (auto_node)))
{
/* Use the deduced type to check the associated constraints. If we
have a partial-concept-id, rebuild the argument list so that
===================================================================
@@ -0,0 +1,6 @@
+// { dg-do compile { target c++14 } }
+// { dg-additional-options "-fconcepts" }
+
+template<int> concept bool C = true;
+
+C c = 0; // { dg-error "invalid reference to concept" }