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++/67048] New: GCC rejects well-formed program using empty anonymous enum specifier in a variable declaration


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67048

            Bug ID: 67048
           Summary: GCC rejects well-formed program using empty anonymous
                    enum specifier in a variable declaration
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: anders.granlund.0 at gmail dot com
  Target Milestone: ---

Consider the following well-formed program (prog.cc):

enum {} x;
int main() {}

Compile it with the following command line:

g++ prog.cc -std=c++14 -pedantic-errors

The following error message is given. I expected to get no error messages since
the program is well-formed.

prog.cc:1:6: error: ISO C++ forbids empty anonymous enum [-Wpedantic]
 enum {} x;
      ^

I have tried this with gcc HEAD 6.0.0 20150728 here:

http://melpon.org/wandbox/permlink/BXXfLL4WOU5lBOfk


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