+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>
* cp-tree.h (finish_static_data_member_decl): New function.
tentative. error_mark_node is replaced later with the BLOCK. */
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. */
if (check < 0)
return decl;
if (ctype == NULL_TREE || check)
return decl;
- if (attrlist)
- cplus_decl_attributes (decl, TREE_PURPOSE (attrlist),
- TREE_VALUE (attrlist));
make_decl_rtl (decl, NULL_PTR, 1);
if (virtualp)
attrlist = build_decl_list (NULL_TREE, inner_attrs);
}
+ /* Now TYPE has the actual type. */
+
if (explicitp == 1)
{
error ("only constructors can be declared `explicit'");
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 (type_quals & TYPE_QUAL_CONST)
declarator = dname;
}
else
+ /* Unexpected declarator format. */
my_friendly_abort (990210);
+ /* If this is declaring a typedef name, return a TYPE_DECL. */
+
if (RIDBIT_SETP (RID_TYPEDEF, specbits) && decl_context != TYPENAME)
{
tree decl;
&& TREE_CHAIN (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)
/* friend or constructor went bad. */
return value;