diff options
author | reichelt <reichelt@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-08-17 08:06:27 +0000 |
---|---|---|
committer | reichelt <reichelt@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-08-17 08:06:27 +0000 |
commit | f2c6bb6c9a10890e0e45a194d07414fa8da03a13 (patch) | |
tree | 7734c5347a8348add91c86f705cb32d36ddb135e /gcc/cp/decl.c | |
parent | 8de7bc60dd2b131159222b79b881a839628a7899 (diff) | |
download | gcc-f2c6bb6c9a10890e0e45a194d07414fa8da03a13.tar.gz |
PR c++/28710
* decl.c (xref_tag): Improve error message. Return early on error.
* g++.dg/template/redecl4.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@116211 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r-- | gcc/cp/decl.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index b03ea62a2ed..a8ec398e1ff 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -9695,7 +9695,8 @@ xref_tag (enum tag_types tag_code, tree name, && CLASSTYPE_IS_TEMPLATE (t)) { error ("redeclaration of %qT as a non-template", t); - t = error_mark_node; + error ("previous declaration %q+D", t); + POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node); } /* Make injected friend class visible. */ |