------- 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

Reply via email to