From ff86beb76a7c3f0f7ad2623d48b952e82f3efebe Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Thu, 22 Jun 1995 22:29:39 -0400 Subject: [PATCH] Call cplus_decl_attributes with prefix_attributes where appropriate. (primary, handler_seq): Set it. From-SVN: r10039 --- gcc/cp/parse.y | 52 ++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 38 insertions(+), 14 deletions(-) diff --git a/gcc/cp/parse.y b/gcc/cp/parse.y index dc60c106c60..ad898e9b498 100644 --- a/gcc/cp/parse.y +++ b/gcc/cp/parse.y @@ -1,5 +1,5 @@ /* YACC parser for C++ syntax. - Copyright (C) 1988, 1989, 1993, 1995 Free Software Foundation, Inc. + Copyright (C) 1988, 1989, 1993, 1994, 1995 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) This file is part of GNU CC. @@ -531,6 +531,7 @@ template_def: { int def = ($4 != ';'); tree d = start_decl ($3, $2, 0, NULL_TREE); + cplus_decl_attributes (d, NULL_TREE, prefix_attributes); cp_finish_decl (d, NULL_TREE, NULL_TREE, 0, 0); end_template_decl ($1, d, 0, def); if (def) @@ -557,6 +558,7 @@ datadef: | declmods notype_declarator ';' { tree d; d = start_decl ($2, $$, 0, NULL_TREE); + cplus_decl_attributes (d, NULL_TREE, prefix_attributes); cp_finish_decl (d, NULL_TREE, NULL_TREE, 0, 0); } | typed_declspecs initdecls ';' @@ -567,6 +569,7 @@ datadef: | typed_declspecs declarator ';' { tree d; d = start_decl ($2, $$, 0, NULL_TREE); + cplus_decl_attributes (d, NULL_TREE, prefix_attributes); cp_finish_decl (d, NULL_TREE, NULL_TREE, 0, 0); note_list_got_semicolon ($$); } @@ -1474,18 +1477,34 @@ primary: } } | functional_cast - | DYNAMIC_CAST '<' type_id '>' '(' expr ')' - { tree type = groktypename ($3); - $$ = build_dynamic_cast (type, $6); } - | STATIC_CAST '<' type_id '>' '(' expr ')' - { tree type = groktypename ($3); - $$ = build_static_cast (type, $6); } - | REINTERPRET_CAST '<' type_id '>' '(' expr ')' - { tree type = groktypename ($3); - $$ = build_reinterpret_cast (type, $6); } - | CONST_CAST '<' type_id '>' '(' expr ')' - { tree type = groktypename ($3); - $$ = build_const_cast (type, $6); } + | DYNAMIC_CAST '<' + { dont_allow_type_definitions = "inside dynamic_cast"; } + type_id '>' + { dont_allow_type_definitions = 0; } + '(' expr ')' + { tree type = groktypename ($4); + $$ = build_dynamic_cast (type, $8); } + | STATIC_CAST '<' + { dont_allow_type_definitions = "inside static_cast"; } + type_id '>' + { dont_allow_type_definitions = 0; } + '(' expr ')' + { tree type = groktypename ($4); + $$ = build_static_cast (type, $8); } + | REINTERPRET_CAST '<' + { dont_allow_type_definitions = "inside reinterpret_cast"; } + type_id '>' + { dont_allow_type_definitions = 0; } + '(' expr ')' + { tree type = groktypename ($4); + $$ = build_reinterpret_cast (type, $8); } + | CONST_CAST '<' + { dont_allow_type_definitions = "inside const_cast"; } + type_id '>' + { dont_allow_type_definitions = 0; } + '(' expr ')' + { tree type = groktypename ($4); + $$ = build_const_cast (type, $8); } | TYPEID '(' expr ')' { $$ = build_typeid ($3); } | TYPEID '(' type_id ')' @@ -1737,6 +1756,7 @@ decl: { tree d = $1; int yes = suspend_momentary (); d = start_decl ($2, d, 0, NULL_TREE); + cplus_decl_attributes (d, NULL_TREE, prefix_attributes); cp_finish_decl (d, NULL_TREE, NULL_TREE, 0, 0); resume_momentary (yes); note_list_got_semicolon ($1); @@ -3427,7 +3447,11 @@ try_block: handler_seq: /* empty */ - | handler_seq CATCH .pushlevel handler_args compstmt + | handler_seq CATCH .pushlevel + { dont_allow_type_definitions = "inside exception declarations"; } + handler_args + { dont_allow_type_definitions = 0; } + compstmt { expand_end_catch_block (); } .poplevel ; -- 2.30.2