Commit c27d68ee by Matthew Beliveau

PR c++/90875 - added -Wswitch-outside-range option

From-SVN: r272567
parent 5a50aed3
// PR c++/90875
void f(char c)
{
switch (c)
case 300: // { dg-warning "case label value exceeds maximum value for type" }
case -300:; // { dg-warning "case label value is less than minimum value for type" }
}
// PR c++/90875
// { dg-options -Wno-switch-outside-range }
void f(char c)
{
switch (c)
case 300: //{ dg-bogus "case label value is less than minimum value for type" }
case -300:; // { dg-bogus "case label value is less than minimum value for type" }
}
// PR c++/90875
// { dg-options -Wno-pedantic }
void f(char c)
{
switch (c)
case -300 ... 300:; // { dg-warning "lower value in case label range less than minimum value for type|upper value in case label range exceeds maximum value for type" }
}
// PR c++/90875
// { dg-options "-Wno-pedantic -Wno-switch-outside-range" }
void f(char c)
{
switch (c)
case -300 ... 300:; // { dg-bogus "lower value in case label range less than minimum value for type|upper value in case label range exceeds maximum value for type" }
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment