diff options
author | Matthew Beliveau <mbelivea@gcc.gnu.org> | 2019-06-21 19:58:32 +0000 |
---|---|---|
committer | Matthew Beliveau <mbelivea@gcc.gnu.org> | 2019-06-21 19:58:32 +0000 |
commit | c27d68ee6d1a15cc12ef20458342202c6c9d4203 (patch) | |
tree | 7629b80a679993973e854d2a4c5c39d8d01fe738 /gcc/testsuite/c-c++-common/Wswitch-outside-range-4.c | |
parent | 5a50aed32ab80022a592091af011f6f0429d269a (diff) | |
download | gcc-c27d68ee6d1a15cc12ef20458342202c6c9d4203.zip gcc-c27d68ee6d1a15cc12ef20458342202c6c9d4203.tar.gz gcc-c27d68ee6d1a15cc12ef20458342202c6c9d4203.tar.bz2 |
PR c++/90875 - added -Wswitch-outside-range option
From-SVN: r272567
Diffstat (limited to 'gcc/testsuite/c-c++-common/Wswitch-outside-range-4.c')
-rw-r--r-- | gcc/testsuite/c-c++-common/Wswitch-outside-range-4.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/testsuite/c-c++-common/Wswitch-outside-range-4.c b/gcc/testsuite/c-c++-common/Wswitch-outside-range-4.c new file mode 100644 index 0000000..d9bd756 --- /dev/null +++ b/gcc/testsuite/c-c++-common/Wswitch-outside-range-4.c @@ -0,0 +1,9 @@ +// 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" } +} |