diff options
author | Jason Merrill <jason@gcc.gnu.org> | 2003-05-27 12:09:28 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2003-05-27 12:09:28 -0400 |
commit | 86982c71d17f2e9888e649fe5c88b65ff84561d8 (patch) | |
tree | 481e79e8ca7de765632a94cd0f1d574e25478dcb /gcc | |
parent | 0f35d192649abdabcec0a8a1cabed1409ff5055e (diff) | |
download | gcc-86982c71d17f2e9888e649fe5c88b65ff84561d8.zip gcc-86982c71d17f2e9888e649fe5c88b65ff84561d8.tar.gz gcc-86982c71d17f2e9888e649fe5c88b65ff84561d8.tar.bz2 |
c-simplify.c (simplify_switch_stmt): A SWITCH_EXPR also gets the source location of its first line.
* c-simplify.c (simplify_switch_stmt): A SWITCH_EXPR also gets the
source location of its first line.
From-SVN: r67188
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/g++.dg/warn/Wswitch-1.C | 12 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/warn/Wswitch-2.C | 8 |
2 files changed, 10 insertions, 10 deletions
diff --git a/gcc/testsuite/g++.dg/warn/Wswitch-1.C b/gcc/testsuite/g++.dg/warn/Wswitch-1.C index e9fcb58..5c68b02 100644 --- a/gcc/testsuite/g++.dg/warn/Wswitch-1.C +++ b/gcc/testsuite/g++.dg/warn/Wswitch-1.C @@ -20,16 +20,16 @@ foo (int i, int j, enum e ei, enum e ej, enum e ek, enum e el, default: break; } switch (ei) - { /* { dg-warning "enumeration value `e1' not handled in switch" "enum e1" { target *-*-* } 24 } */ - } /* { dg-warning "enumeration value `e2' not handled in switch" "enum e2" } */ + { /* { dg-warning "enumeration value `e1' not handled in switch" "enum e1" } */ + } /* { dg-warning "enumeration value `e2' not handled in switch" "enum e2" { target *-*-* } 23 } */ switch (ej) { default: break; } - switch (ek) + switch (ek) /* { dg-warning "enumeration value `e2' not handled in switch" "enum e2" } */ { case e1: return 1; - } /* { dg-warning "enumeration value `e2' not handled in switch" "enum e2" } */ + } switch (el) { case e1: return 1; @@ -46,12 +46,12 @@ foo (int i, int j, enum e ei, enum e ej, enum e ek, enum e el, case e2: return 2; default: break; } - switch (eo) + switch (eo) /* { dg-warning "case value `3' not in enumerated type `e'" "excess 3" } */ { case e1: return 1; case e2: return 2; case 3: return 3; - } /* { dg-warning "case value `3' not in enumerated type `e'" "excess 3" } */ + } switch (ep) { case e1: return 1; diff --git a/gcc/testsuite/g++.dg/warn/Wswitch-2.C b/gcc/testsuite/g++.dg/warn/Wswitch-2.C index b151e23..9bc7d02 100644 --- a/gcc/testsuite/g++.dg/warn/Wswitch-2.C +++ b/gcc/testsuite/g++.dg/warn/Wswitch-2.C @@ -13,19 +13,19 @@ foo (enum e ei, int j) case e3: return 2; case e4: return 3; } /* No warning here since e2 has the same value as e3. */ - switch (ei) + switch (ei) /* { dg-warning "enumeration value `e4' not handled in switch" "enum e4" } */ { case e1: return 1; case e2: return 2; - } /* { dg-warning "enumeration value `e4' not handled in switch" "enum e4" } */ + } switch ((int) ei) { case e1: return 1; } /* No warning here since switch condition was cast to int. */ - switch ((enum e) j) + switch ((enum e) j) /* { dg-warning "enumeration value `e1' not handled in switch" "enum e1" } */ { case e2: return 1; case e4: return 2; - } /* { dg-warning "enumeration value `e1' not handled in switch" "enum e1" } */ + } return 0; } |