[Bug c++/39219] New: attribute deprecated doesn't work with enums

sebor at roguewave dot com gcc-bugzilla@gcc.gnu.org
Tue Feb 17 19:09:00 GMT 2009


According to the documentation:
    The deprecated attribute results in a warning if the type is used anywhere
    in the source file.

The following test case shows that when applied to an enum definition the
attribute has no such effect (this is in contrast to applying the attribute
to a class definition where it does have the expected effect):

$ cat -n u.cpp && g++ -dumpversion && g++ -W -Wall -Werror -c u.cpp; echo $?
     1  enum __attribute__ ((deprecated)) E { e };
     2  struct S { enum __attribute__ ((deprecated)) F { f = e }; };
     3
     4  int main () {
     5      E x;
     6      x = e;
     7
     8      S::F y;
     9      y = S::f;
    10
    11      return x + y;
    12  }
4.3.1
0


-- 
           Summary: attribute deprecated doesn't work with enums
           Product: gcc
           Version: 4.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sebor at roguewave dot com


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



More information about the Gcc-bugs mailing list