diff options
Diffstat (limited to 'gcc/cp/pt.c')
| -rw-r--r-- | gcc/cp/pt.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 17557c0..79d9de4 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -673,13 +673,20 @@ check_explicit_instantiation_namespace (tree spec) /* The TYPE is being declared. If it is a template type, that means it is a partial specialization. Do appropriate error-checking. */ -void +tree maybe_process_partial_specialization (tree type) { tree context; if (type == error_mark_node) - return; + return error_mark_node; + + if (TREE_CODE (type) == BOUND_TEMPLATE_TEMPLATE_PARM) + { + error ("name of class shadows template template parameter %qD", + TYPE_NAME (type)); + return error_mark_node; + } context = TYPE_CONTEXT (type); @@ -764,7 +771,12 @@ maybe_process_partial_specialization (tree type) } } else if (processing_specialization) - error ("explicit specialization of non-template %qT", type); + { + error ("explicit specialization of non-template %qT", type); + return error_mark_node; + } + + return type; } /* Returns nonzero if we can optimize the retrieval of specializations |
