diff options
author | Mark Mitchell <mark@codesourcery.com> | 2007-03-23 04:37:40 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2007-03-23 04:37:40 +0000 |
commit | 8b84995aa37df18b21abcf161f23da7f957dc17d (patch) | |
tree | 9723544456dacd2f3c339caf6c315be105a9a932 /gcc/cp/parser.c | |
parent | 725d6b877d6861a3075175c6620b6339f15eac6e (diff) | |
download | gcc-8b84995aa37df18b21abcf161f23da7f957dc17d.zip gcc-8b84995aa37df18b21abcf161f23da7f957dc17d.tar.gz gcc-8b84995aa37df18b21abcf161f23da7f957dc17d.tar.bz2 |
re PR c++/30863 (Unsigned templatized struct treated as unsigned int)
PR c++/30863
* parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do
not consume tokens when failing.
PR c++/30863
* g++.dg/template/error24.C: New test.
* g++.dg/parse/tmpl-outside1.C: Tweak error markers.
From-SVN: r123152
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r-- | gcc/cp/parser.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 41e7b52..5cfcf43 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -2343,12 +2343,13 @@ cp_parser_parse_and_diagnose_invalid_type_name (cp_parser *parser) the scope is dependent, we cannot do much. */ if (!cp_lexer_next_token_is (parser->lexer, CPP_NAME) || (parser->scope && TYPE_P (parser->scope) - && dependent_type_p (parser->scope))) + && dependent_type_p (parser->scope)) + || TREE_CODE (id) == TYPE_DECL) { cp_parser_abort_tentative_parse (parser); return false; } - if (!cp_parser_parse_definitely (parser) || TREE_CODE (id) == TYPE_DECL) + if (!cp_parser_parse_definitely (parser)) return false; /* Emit a diagnostic for the invalid type. */ |