aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorMark Mitchell <mmitchel@gcc.gnu.org>2005-04-05 17:35:54 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2005-04-05 17:35:54 +0000
commitf4f18103eef5b8f43652efda3aefc7568773052d (patch)
tree87bdb49d532ac4a493ba23bdf9892373bc4d56b1 /gcc/cp
parent3e0de9d1880ccba36323b5d6c81bc2a0bae912f8 (diff)
downloadgcc-f4f18103eef5b8f43652efda3aefc7568773052d.zip
gcc-f4f18103eef5b8f43652efda3aefc7568773052d.tar.gz
gcc-f4f18103eef5b8f43652efda3aefc7568773052d.tar.bz2
re PR target/20673 (C PCH testsuite assembly comparison failure)
PR c++/20673 * decl.c (grokdeclarator): Correct attribute handling. PR c++/20673 * g++.dg/ext/attrib21.C: New test. From-SVN: r97640
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/decl.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index eef2cb1..9618b4d 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -7059,9 +7059,7 @@ grokdeclarator (const cp_declarator *declarator,
/* Determine the type of the entity declared by recurring on the
declarator. */
- for (;
- declarator && declarator->kind != cdk_id;
- declarator = declarator->declarator)
+ for (; declarator; declarator = declarator->declarator)
{
const cp_declarator *inner_declarator;
tree attrs;
@@ -7069,8 +7067,6 @@ grokdeclarator (const cp_declarator *declarator,
if (type == error_mark_node)
return error_mark_node;
- inner_declarator = declarator->declarator;
-
attrs = declarator->attributes;
if (attrs)
{
@@ -7088,6 +7084,11 @@ grokdeclarator (const cp_declarator *declarator,
attr_flags);
}
+ if (declarator->kind == cdk_id)
+ break;
+
+ inner_declarator = declarator->declarator;
+
switch (declarator->kind)
{
case cdk_array: