diff options
author | dannysmith <dannysmith@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-02-24 09:19:39 +0000 |
---|---|---|
committer | dannysmith <dannysmith@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-02-24 09:19:39 +0000 |
commit | 230c4e2fc4fda9e65781f9ce460b377aa1005028 (patch) | |
tree | 40c61febe42d8e42bc09fb68c73f43dc0b9b2dc6 /gcc/cp/friend.c | |
parent | 070270ea67a52ddb782e145ab71874962d718bce (diff) | |
download | gcc-230c4e2fc4fda9e65781f9ce460b377aa1005028.tar.gz |
cp
PR c++/34749
* friend.c (do_friend): Call cplus_decl_attributes earlier.
testsuite
PR c++/34749
* g++.dg.ext/dllimport13.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@132585 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/friend.c')
-rw-r--r-- | gcc/cp/friend.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gcc/cp/friend.c b/gcc/cp/friend.c index ffb0baaa600..c4dfcc58798 100644 --- a/gcc/cp/friend.c +++ b/gcc/cp/friend.c @@ -413,6 +413,13 @@ do_friend (tree ctype, tree declarator, tree decl, /* Every decl that gets here is a friend of something. */ DECL_FRIEND_P (decl) = 1; + /* Unfortunately, we have to handle attributes here. Normally we would + handle them in start_decl_1, but since this is a friend decl start_decl_1 + never gets to see it. */ + + /* Set attributes here so if duplicate decl, will have proper attributes. */ + cplus_decl_attributes (&decl, attrlist, 0); + if (TREE_CODE (declarator) == TEMPLATE_ID_EXPR) { declarator = TREE_OPERAND (declarator, 0); @@ -582,12 +589,5 @@ do_friend (tree ctype, tree declarator, tree decl, DECL_FRIEND_P (decl) = 1; } - /* Unfortunately, we have to handle attributes here. Normally we would - handle them in start_decl_1, but since this is a friend decl start_decl_1 - never gets to see it. */ - - /* Set attributes here so if duplicate decl, will have proper attributes. */ - cplus_decl_attributes (&decl, attrlist, 0); - return decl; } |