aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@yorick.cygnus.com>1999-04-20 01:20:07 +0000
committerJason Merrill <jason@gcc.gnu.org>1999-04-19 21:20:07 -0400
commit419c62125982f257ef80953a416a58153608ffee (patch)
tree8501fb2d887b6763aa0f2168e2fe32d6b9383134
parentaa9b7b48b69d1d062b753b6569d704eceb892fb4 (diff)
downloadgcc-419c62125982f257ef80953a416a58153608ffee.zip
gcc-419c62125982f257ef80953a416a58153608ffee.tar.gz
gcc-419c62125982f257ef80953a416a58153608ffee.tar.bz2
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
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/decl.c16
-rw-r--r--gcc/cp/decl2.c2
3 files changed, 15 insertions, 8 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index d8bdb2c..6166802 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+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.
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 87eae50..d611236 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -8701,6 +8701,10 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals,
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;
@@ -8793,9 +8797,6 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals,
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)
@@ -10759,16 +10760,14 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
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)
@@ -10795,8 +10794,11 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
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;
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 744baae..70c9727 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -1570,7 +1570,7 @@ grokfield (declarator, declspecs, init, asmspec_tree, attrlist)
&& 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;