Commit 419c6212 by Jason Merrill Committed by Jason Merrill

decl.c (grokfndecl): Always call cplus_decl_attributes.

	* decl.c (grokfndecl): Always call cplus_decl_attributes.
	* decl2.c (grokfield): Pass attrlist to grokdeclarator.

From-SVN: r26558
parent aa9b7b48
1999-04-20 Jason Merrill <jason@yorick.cygnus.com>
* decl.c (grokfndecl): Always call cplus_decl_attributes.
* decl2.c (grokfield): Pass attrlist to grokdeclarator.
1999-04-19 Mark Mitchell <mark@codesourcery.com> 1999-04-19 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (finish_static_data_member_decl): New function. * cp-tree.h (finish_static_data_member_decl): New function.
......
...@@ -8701,6 +8701,10 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals, ...@@ -8701,6 +8701,10 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals,
tentative. error_mark_node is replaced later with the BLOCK. */ tentative. error_mark_node is replaced later with the BLOCK. */
DECL_INITIAL (decl) = error_mark_node; DECL_INITIAL (decl) = error_mark_node;
if (attrlist)
cplus_decl_attributes (decl, TREE_PURPOSE (attrlist),
TREE_VALUE (attrlist));
/* Caller will do the rest of this. */ /* Caller will do the rest of this. */
if (check < 0) if (check < 0)
return decl; return decl;
...@@ -8793,9 +8797,6 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals, ...@@ -8793,9 +8797,6 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals,
if (ctype == NULL_TREE || check) if (ctype == NULL_TREE || check)
return decl; return decl;
if (attrlist)
cplus_decl_attributes (decl, TREE_PURPOSE (attrlist),
TREE_VALUE (attrlist));
make_decl_rtl (decl, NULL_PTR, 1); make_decl_rtl (decl, NULL_PTR, 1);
if (virtualp) if (virtualp)
...@@ -10759,16 +10760,14 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist) ...@@ -10759,16 +10760,14 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
attrlist = build_decl_list (NULL_TREE, inner_attrs); attrlist = build_decl_list (NULL_TREE, inner_attrs);
} }
/* Now TYPE has the actual type. */
if (explicitp == 1) if (explicitp == 1)
{ {
error ("only constructors can be declared `explicit'"); error ("only constructors can be declared `explicit'");
explicitp = 0; explicitp = 0;
} }
/* Now TYPE has the actual type. */
/* If this is declaring a typedef name, return a TYPE_DECL. */
if (RIDBIT_SETP (RID_MUTABLE, specbits)) if (RIDBIT_SETP (RID_MUTABLE, specbits))
{ {
if (type_quals & TYPE_QUAL_CONST) if (type_quals & TYPE_QUAL_CONST)
...@@ -10795,8 +10794,11 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist) ...@@ -10795,8 +10794,11 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
declarator = dname; declarator = dname;
} }
else else
/* Unexpected declarator format. */
my_friendly_abort (990210); my_friendly_abort (990210);
/* If this is declaring a typedef name, return a TYPE_DECL. */
if (RIDBIT_SETP (RID_TYPEDEF, specbits) && decl_context != TYPENAME) if (RIDBIT_SETP (RID_TYPEDEF, specbits) && decl_context != TYPENAME)
{ {
tree decl; tree decl;
......
...@@ -1570,7 +1570,7 @@ grokfield (declarator, declspecs, init, asmspec_tree, attrlist) ...@@ -1570,7 +1570,7 @@ grokfield (declarator, declspecs, init, asmspec_tree, attrlist)
&& TREE_CHAIN (init) == NULL_TREE) && TREE_CHAIN (init) == NULL_TREE)
init = NULL_TREE; init = NULL_TREE;
value = grokdeclarator (declarator, declspecs, FIELD, init != 0, NULL_TREE); value = grokdeclarator (declarator, declspecs, FIELD, init != 0, attrlist);
if (! value || value == error_mark_node) if (! value || value == error_mark_node)
/* friend or constructor went bad. */ /* friend or constructor went bad. */
return value; return value;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment