[Bug c++/39219] attribute doesn't work with enums properly

2011-04-28 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39219

Richard Guenther  changed:

   What|Removed |Added

   Target Milestone|4.4.7   |---


[Bug c++/39219] attribute doesn't work with enums properly

2011-04-16 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39219

Jakub Jelinek  changed:

   What|Removed |Added

   Target Milestone|4.4.6   |4.4.7


[Bug c++/39219] attribute doesn't work with enums properly

2010-10-01 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39219

Jakub Jelinek  changed:

   What|Removed |Added

   Target Milestone|4.4.5   |4.4.6


[Bug c++/39219] attribute doesn't work with enums properly

2010-04-30 Thread jakub at gcc dot gnu dot org


-- 

jakub at gcc dot gnu dot org changed:

   What|Removed |Added

   Target Milestone|4.4.4   |4.4.5


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



[Bug c++/39219] attribute doesn't work with enums properly

2010-01-21 Thread jakub at gcc dot gnu dot org


-- 

jakub at gcc dot gnu dot org changed:

   What|Removed |Added

   Target Milestone|4.4.3   |4.4.4


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



[Bug c++/39219] attribute doesn't work with enums properly

2009-10-15 Thread jakub at gcc dot gnu dot org


-- 

jakub at gcc dot gnu dot org changed:

   What|Removed |Added

   Target Milestone|4.4.2   |4.4.3


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



[Bug c++/39219] attribute doesn't work with enums properly

2009-07-22 Thread alex dot gcc dot gnu dot org at firetree dot net


--- Comment #10 from alex dot gcc dot gnu dot org at firetree dot net  
2009-07-22 10:55 ---
This problem seems to affect all enum attributes that are declared with the
"preferred" syntax. For example, the following enum is not packed, not is a
warning emitted:

enum __attribute__((packed)) Foo {Bar,Baz,Qux};

Here's a quote from the manual:

"""
An attribute specifier list may appear as part of a struct, union or enum
specifier. It may go either immediately after the struct, union or enum
keyword, or after the closing brace. The former syntax is preferred.
"""

(http://gcc.gnu.org/onlinedocs/gcc-4.3.2/gcc/Attribute-Syntax.html#Attribute-Syntax)

If the functionality can't be easily fixed, then it would be nice to see a
warning at compile time. At the very least, the manual should be corrected.


-- 

alex dot gcc dot gnu dot org at firetree dot net changed:

   What|Removed |Added

 CC||alex dot gcc dot gnu dot org
   ||at firetree dot net


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



[Bug c++/39219] attribute doesn't work with enums properly

2009-07-22 Thread jakub at gcc dot gnu dot org


-- 

jakub at gcc dot gnu dot org changed:

   What|Removed |Added

   Target Milestone|4.4.1   |4.4.2


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



[Bug c++/39219] attribute doesn't work with enums properly

2009-04-21 Thread jakub at gcc dot gnu dot org


-- 

jakub at gcc dot gnu dot org changed:

   What|Removed |Added

   Target Milestone|4.4.0   |4.4.1


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



[Bug c++/39219] attribute doesn't work with enums properly

2009-02-20 Thread hjl dot tools at gmail dot com


--- Comment #9 from hjl dot tools at gmail dot com  2009-02-20 14:47 ---
(In reply to comment #6)
> (In reply to comment #5)
> > Should attribute work on enum constants?
> 
> Not sure if this is a question for me but IMO, it should. I would expect
> individual enumerators to be more heavily referenced than their types
> (sometimes even exclusively) and the warning to be of equal importance
> for both. In addition, just like declaring a class deprecated implies
> that all members of the class are deprecated, so should declaring
> an enumeration deprecated imply that all its enumerators are.

__attribute__((deprecated)) can be used on class members.

> Finally, since enumerators of unnamed types can be declared deprecated
> not issuing the warning would make such declarations pointless:
> 
> $ cat u.cpp && g++ -W -Wall -Werror -c u.cpp
> enum __attribute__((deprecated)) { e };
> int i = e;   // warning missing
> $

I don't believe gcc supports

enum { e __attribute__((deprecated)) }; 


-- 


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



[Bug c++/39219] attribute doesn't work with enums properly

2009-02-18 Thread hjl at gcc dot gnu dot org


--- Comment #8 from hjl at gcc dot gnu dot org  2009-02-19 01:58 ---
Subject: Bug 39219

Author: hjl
Date: Thu Feb 19 01:58:15 2009
New Revision: 144284

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=144284
Log:
gcc/cp

2009-02-18  H.J. Lu  

PR c++/39219
* parser.c (cp_parser_enum_specifier): Apply all attributes.

gcc/testsuite/

2009-02-18  H.J. Lu  

PR c++/39219
* g++.dg/parse/attr3.C: New.

Added:
trunk/gcc/testsuite/g++.dg/parse/attr3.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/parser.c
trunk/gcc/testsuite/ChangeLog


-- 


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



[Bug c++/39219] attribute doesn't work with enums properly

2009-02-18 Thread hjl dot tools at gmail dot com


--- Comment #7 from hjl dot tools at gmail dot com  2009-02-18 23:44 ---
(In reply to comment #3)
> A patch is posted at
> 
> http://gcc.gnu.org/ml/gcc-patches/2009-02/msg00790.html
> 

Jason, can you take a look at this one line fix? Thanks.


-- 

hjl dot tools at gmail dot com changed:

   What|Removed |Added

 CC||jason at redhat dot com


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



[Bug c++/39219] attribute doesn't work with enums properly

2009-02-18 Thread sebor at roguewave dot com


--- Comment #6 from sebor at roguewave dot com  2009-02-18 16:50 ---
(In reply to comment #5)
> Should attribute work on enum constants?

Not sure if this is a question for me but IMO, it should. I would expect
individual enumerators to be more heavily referenced than their types
(sometimes even exclusively) and the warning to be of equal importance
for both. In addition, just like declaring a class deprecated implies
that all members of the class are deprecated, so should declaring
an enumeration deprecated imply that all its enumerators are.

Finally, since enumerators of unnamed types can be declared deprecated
not issuing the warning would make such declarations pointless:

$ cat u.cpp && g++ -W -Wall -Werror -c u.cpp
enum __attribute__((deprecated)) { e };
int i = e;   // warning missing
$


-- 


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



[Bug c++/39219] attribute doesn't work with enums properly

2009-02-17 Thread hjl dot tools at gmail dot com


--- Comment #5 from hjl dot tools at gmail dot com  2009-02-17 21:38 ---
Should attribute work on enum constants?


-- 


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



[Bug c++/39219] attribute doesn't work with enums properly

2009-02-17 Thread sebor at roguewave dot com


--- Comment #4 from sebor at roguewave dot com  2009-02-17 21:00 ---
Thanks for looking into so quickly!

In addition to the missing warnings mentioned in the initial report I would
expect a warning for each of the references to e below (i.e., on lines 3, 9,
and 15), analogously to those already issued:

$ cat -n u.cpp && g++ -W -Wall -Werror -c u.cpp; echo $?
 1  struct A {
 2  enum __attribute__ ((deprecated)) E { e };
 3  enum F { f = e };   // missing warning
 4  static const E g = e;   // missing warning
 5  };
 6
 7  struct B {
 8  enum E { e } __attribute__ ((deprecated));
 9  enum F { f = e };   // missing warning
10  static const E g = e;
11  };
12
13  struct C {
14  typedef enum { e } E __attribute__ ((deprecated));
15  enum F { f = e };   // missing warning
16  static const E g = e;
17  };
cc1plus: warnings being treated as errors
u.cpp:10: error: 'E' is deprecated (declared at u.cpp:8)
u.cpp:16: error: 'C::E' is deprecated (declared at u.cpp:14)
1


-- 


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



[Bug c++/39219] attribute doesn't work with enums properly

2009-02-17 Thread hjl dot tools at gmail dot com


--- Comment #3 from hjl dot tools at gmail dot com  2009-02-17 20:29 ---
A patch is posted at

http://gcc.gnu.org/ml/gcc-patches/2009-02/msg00790.html


-- 

hjl dot tools at gmail dot com changed:

   What|Removed |Added

URL||http://gcc.gnu.org/ml/gcc-
   ||patches/2009-
   ||02/msg00790.html
   Target Milestone|--- |4.4.0


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