diff options
author | Joseph Myers <joseph@codesourcery.com> | 2005-04-06 18:17:38 +0100 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2005-04-06 18:17:38 +0100 |
commit | 3693d46c9777b4e24b42467a80e47f32f727aa71 (patch) | |
tree | 649a1980a862ee27ee5452e2511599dbef83526b /gcc/cp | |
parent | c634366a354b7f9065616adea64cd5506d347b36 (diff) | |
download | gcc-3693d46c9777b4e24b42467a80e47f32f727aa71.zip gcc-3693d46c9777b4e24b42467a80e47f32f727aa71.tar.gz gcc-3693d46c9777b4e24b42467a80e47f32f727aa71.tar.bz2 |
c-decl.c (finish_decl): Apply pending #pragma weak regardless of scope.
* c-decl.c (finish_decl): Apply pending #pragma weak regardless of
scope.
cp:
* decl.c (start_decl): Apply pending #pragma weak regardless of
scope.
testsuite:
* gcc.dg/weak/weak-12.c, g++.dg/ext/weak2.C: New tests.
From-SVN: r97733
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/decl.c | 3 |
2 files changed, 6 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 39e5a45..e0b452c 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2005-04-06 Joseph S. Myers <joseph@codesourcery.com> + + * decl.c (start_decl): Apply pending #pragma weak regardless of + scope. + 2005-04-06 Mark Mitchell <mark@codesourcery.com> PR c++/20212 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 9618b4d..acf8a85 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -3654,8 +3654,7 @@ start_decl (const cp_declarator *declarator, cplus_decl_attributes (&decl, attributes, 0); /* If #pragma weak was used, mark the decl weak now. */ - if (global_scope_p (current_binding_level)) - maybe_apply_pragma_weak (decl); + maybe_apply_pragma_weak (decl); if (TREE_CODE (decl) == FUNCTION_DECL && DECL_DECLARED_INLINE_P (decl) |