https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98418
Bug ID: 98418
Summary: Valid integer constant expressions based on
expressions that trigger -Wshift-overflow are treated
as non-constants
Product: gcc
Version: 6.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: pskocik at gmail dot com
Target Milestone: ---
This causes things like:
struct foo { unsigned bit: (0xffffffffll<<40)!=0; };
to elicit a -pedantic warning about the bitfield width not being a proper
integer constant expression, even though it is.
In other contexts, a complete compilation error might ensue:
extern int bar[ (0xffffffffll<<40)!=0 ]; //seen as an invalid VLA
https://gcc.godbolt.org/z/7zfz96
Neither clang nor gcc <= 5 appear to have this bug.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93241 seems related.