[Bug c++/39159] unhelpful attribute warning on matching declaration after definition

sebor at roguewave dot com gcc-bugzilla@gcc.gnu.org
Thu Feb 12 17:02:00 GMT 2009



------- Comment #1 from sebor at roguewave dot com  2009-02-12 17:02 -------
In addition, as the test case below shows, the warning is issued inconsistently
between classes and functions, suggesting that the instance of the warning on
the class declaration on line 2 might be a bug rather than a feature:

$ cat -n t.C && g++ -dumpversion && g++ -c t.C
     1  struct __attribute__ ((visibility ("default"))) A { };
     2  struct __attribute__ ((visibility ("default"))) A;
     3
     4  void __attribute__ ((visibility ("default"))) foo () { }
     5  void __attribute__ ((visibility ("default"))) foo ();
4.3.1
t.C:2: warning: type attributes ignored after type is already defined


-- 


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



More information about the Gcc-bugs mailing list