public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug regression/52973] New: visibility attribute for class is not passed to its members
@ 2012-04-13 12:36 holger.hopp at sap dot com
  2012-04-13 12:47 ` [Bug c++/52973] [4.7/4.8 Regression] " rguenth at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: holger.hopp at sap dot com @ 2012-04-13 12:36 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52973

             Bug #: 52973
           Summary: visibility attribute for class is not passed to its
                    members
    Classification: Unclassified
           Product: gcc
           Version: 4.7.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: regression
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: holger.hopp@sap.com


In following code, gcc-4.7 does not accept the visibility attribute
defined in the class declaration:

template <class T> class __attribute__((visibility("default"))) a
{
public:
  /* A */ static int c;
};

class __attribute__((visibility("default"))) b : a <b> {};

template<> /* B */ int a<b>::c = 0;


With g++-4.7, a<b>::c is hidden, with g++-4.6 (and before) it is not.

$ g++-4.7 -fvisibility=hidden -c def.cpp && objdump -Ct def.o | grep "a<b>"
0000000000000000 g     O .bss    0000000000000004 .hidden a<b>::c

$ g++-4.6 -fvisibility=hidden -c def.cpp && objdump -Ct def.o | grep "a<b>"
0000000000000000 g     O .bss    0000000000000004 a<b>::c

Setting the default visibility at /* A */ or /* B */ works with
g++-4.7, but I think that it still should work also with the code above.


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-06-02  4:06 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-13 12:36 [Bug regression/52973] New: visibility attribute for class is not passed to its members holger.hopp at sap dot com
2012-04-13 12:47 ` [Bug c++/52973] [4.7/4.8 Regression] " rguenth at gcc dot gnu.org
2012-04-13 13:19 ` rguenth at gcc dot gnu.org
2012-04-15  9:11 ` paolo.carlini at oracle dot com
2012-06-01 21:22 ` jason at gcc dot gnu.org
2012-06-01 21:36 ` jason at gcc dot gnu.org
2012-06-02  4:04 ` jason at gcc dot gnu.org
2012-06-02  4:05 ` jason at gcc dot gnu.org
2012-06-02  4:06 ` jason at gcc dot gnu.org
2012-06-02  4:06 ` jason at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).