aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/parser.c
diff options
context:
space:
mode:
authorLee Millward <lee.millward@codesourcery.com>2006-12-07 19:16:38 +0000
committerLee Millward <lmillward@gcc.gnu.org>2006-12-07 19:16:38 +0000
commitbaa5bf1141c3d697abe54c6e1a8ee87a33f67015 (patch)
tree1d996afa86f04647fbe2996fbfe60de993cc6ad1 /gcc/cp/parser.c
parentf4ab8916060b271dcfaf2936af09dfd8af44df7e (diff)
downloadgcc-baa5bf1141c3d697abe54c6e1a8ee87a33f67015.zip
gcc-baa5bf1141c3d697abe54c6e1a8ee87a33f67015.tar.gz
gcc-baa5bf1141c3d697abe54c6e1a8ee87a33f67015.tar.bz2
re PR c++/29980 (ICE using attribute in invalid declaration)
PR c++/29980 * cp_parser_elaborated_type_specifier: Check the return value of check_elaborated_type_specifier. * g++.dg/ext/attrib27.C: New test. * g++.dg/parse/struct-as-enum1.C: Adjust error markers. * g++.dg/parse/typedef5.C: Likewise. From-SVN: r119633
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r--gcc/cp/parser.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index cdb60f6..a0a6a17 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -10311,10 +10311,15 @@ cp_parser_elaborated_type_specifier (cp_parser* parser,
}
if (TREE_CODE (TREE_TYPE (decl)) != TYPENAME_TYPE)
- check_elaborated_type_specifier
- (tag_type, decl,
- (parser->num_template_parameter_lists
- || DECL_SELF_REFERENCE_P (decl)));
+ {
+ bool allow_template = (parser->num_template_parameter_lists
+ || DECL_SELF_REFERENCE_P (decl));
+ type = check_elaborated_type_specifier (tag_type, decl,
+ allow_template);
+
+ if (type == error_mark_node)
+ return error_mark_node;
+ }
type = TREE_TYPE (decl);
}