https://bugs.llvm.org/show_bug.cgi?id=38238
Bug ID: 38238
Summary: left operand of shift expression ‘(-1 << 4)’ is
negative
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: C++
Assignee: unassignedclangb...@nondot.org
Reporter: zhong...@pku.org.cn
CC: dgre...@apple.com, llvm-bugs@lists.llvm.org
The code is as follow:
enum A { bit_mask = ~(-1 << 4) };
clang++ accepts it, but g++ rejects it:
code0.cpp:1:26: error: left operand of shift expression '(-1 << 4)' is negative
[-fpermissive]
enum A { bit_mask = ~(-1 << 4) };
~~~~^~~~~
code0.cpp:1:30: error: enumerator value for 'bit_mask' is not an integer
constant
enum A { bit_mask = ~(-1 << 4) };
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs