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

            Bug ID: 67047
           Summary: GCC accepts ill-formed program with enumerator not
                    representable in uintmax_t
           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 program (prog.cc):

#include <cstdint>
#include <limits>
enum { x = std::numeric_limits<std::uintmax_t>::max(), y };
int main() {}

Compile it with the following command line:

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

No error messages are given. The program is ill-formed by the last sentence of
the third list item of [dcl.enum]p5 (http://eel.is/c++draft/dcl.enum#5) so at
least one error message was expected.

I have tried this with gcc HEAD 6.0.0 20150728 here:

http://melpon.org/wandbox/permlink/8EVR4wM7TqLBTrVG

Reply via email to