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

            Bug ID: 69631
           Summary: Bogus overflow in constant expression error
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mpolacek at gcc dot gnu.org
  Target Milestone: ---

Starting with the C++ delayed folding merge, we reject this test with -fwrapv:

struct C {
  static const unsigned short max = static_cast<unsigned short>((32767 * 2 +
1));
};

q.C:2:80: error: overflow in constant expression [-fpermissive]
   static const unsigned short max = static_cast<unsigned short>((32767 * 2 +
1));
                                                                               
^
q.C:2:80: error: overflow in constant expression [-fpermissive]
q.C:2:80: error: overflow in constant expression [-fpermissive]
q.C:2:80: error: overflow in constant expression [-fpermissive]

Reply via email to