This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]