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

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
This also fixed a rejects-valid

int lValue;
int main()
{
  switch (lValue)
    {
    case -(int)((2U << (8 * sizeof(int) - 2)) - 1) - 1:;
    }
}

> g++-4.8 cMinLongValue.ii 
cMinLongValue.ii: In function ‘int main()’:
cMinLongValue.ii:6:54: error: overflow in constant expression [-fpermissive]
     case -(int)((2U << (8 * sizeof(int) - 2)) - 1) - 1:;
                                                      ^
cMinLongValue.ii:6:54: error: overflow in constant expression [-fpermissive]

I am going to backport and add this testcase.

Reply via email to