summaryrefslogtreecommitdiff
path: root/gcc/cp/decl.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r--gcc/cp/decl.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 7b932c05b1e..84f2aaa49b3 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -9712,7 +9712,10 @@ xref_tag (enum tag_types tag_code, tree name,
else
{
if (template_header_p && IS_AGGR_TYPE (t))
- redeclare_class_template (t, current_template_parms);
+ {
+ if (!redeclare_class_template (t, current_template_parms))
+ POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node);
+ }
else if (!processing_template_decl
&& CLASS_TYPE_P (t)
&& CLASSTYPE_IS_TEMPLATE (t))