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

            Bug ID: 68252
           Summary: regiression left operand of shift expression, while we
                    shift > 0 integer
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dushistov at mail dot ru
  Target Milestone: ---

struct Test {                                                                   
  static const int foo = (1 << sizeof(int))*(-3);                               
};

$ g++ -c -Wall -Wextra -pedantic -std=c++11 test_bug.cpp test_bug.cpp:2:44:
error: left operand of shift expression '(-3 << 4ul)' is negative
   static const int foo = (1 << sizeof(int))*(-3);                              
                                            ^


while clang not give any errors, plus gcc 4.9.3 also not produce any errors.

Reply via email to