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