diff options
author | Jakub Jelinek <jakub@redhat.com> | 2016-10-08 12:54:27 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2016-10-08 12:54:27 +0200 |
commit | ee19ef45ba9dc5a783303e353d538e83dabe3377 (patch) | |
tree | 2bb03fc407441f31957cbe3fcb1f2eeb60783246 /gcc | |
parent | 81b02905b035e7afee46c38186c95434b6d86813 (diff) | |
download | gcc-ee19ef45ba9dc5a783303e353d538e83dabe3377.zip gcc-ee19ef45ba9dc5a783303e353d538e83dabe3377.tar.gz gcc-ee19ef45ba9dc5a783303e353d538e83dabe3377.tar.bz2 |
invoke.texi: Document accepting Else, fallthrough.
* doc/invoke.texi: Document accepting Else, fallthrough.
* lex.c (fallthrough_comment_p): Accept Else, fallthrough.
* c-c++-common/Wimplicit-fallthrough-23.c (foo): Add further tests.
From-SVN: r240886
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 2 | ||||
-rw-r--r-- | gcc/doc/invoke.texi | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 2 | ||||
-rw-r--r-- | gcc/testsuite/c-c++-common/Wimplicit-fallthrough-23.c | 12 |
4 files changed, 19 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f547a7b..fa748f3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,7 @@ 2016-10-08 Jakub Jelinek <jakub@redhat.com> + * doc/invoke.texi: Document accepting Else, fallthrough. + * doc/invoke.texi (-Wimplicit-fallthrough): Document FALLTHRU comment style changes. diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 65805ba..8d8fdee 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -4181,11 +4181,11 @@ should match one of the following regular expressions: @item @code{lint -fallthrough ?} -@item @code{[ \t.!]*(ELSE |INTENTIONAL(LY)? )?FALL(S | |-)?THR(OUGH|U)[ \t.!]*(-[^\n\r]*)?} +@item @code{[ \t.!]*(ELSE,? |INTENTIONAL(LY)? )?FALL(S | |-)?THR(OUGH|U)[ \t.!]*(-[^\n\r]*)?} -@item @code{[ \t.!]*(Else |Intentional(ly)? )?Fall((s | |-)[Tt]|t)hr(ough|u)[ \t.!]*(-[^\n\r]*)?} +@item @code{[ \t.!]*(Else,? |Intentional(ly)? )?Fall((s | |-)[Tt]|t)hr(ough|u)[ \t.!]*(-[^\n\r]*)?} -@item @code{[ \t.!]*([Ee]lse |[Ii]ntentional(ly)? )?fall(s | |-)?thr(ough|u)[ \t.!]*(-[^\n\r]*)?} +@item @code{[ \t.!]*([Ee]lse,? |[Ii]ntentional(ly)? )?fall(s | |-)?thr(ough|u)[ \t.!]*(-[^\n\r]*)?} @end itemize diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 12b9009..9422a47 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -2,6 +2,8 @@ * c-c++-common/Wimplicit-fallthrough-23.c (foo): Add further tests. + * c-c++-common/Wimplicit-fallthrough-23.c (foo): Add further tests. + * c-c++-common/Wimplicit-fallthrough-23.c: New test. * c-c++-common/Wimplicit-fallthrough-24.c: New test. diff --git a/gcc/testsuite/c-c++-common/Wimplicit-fallthrough-23.c b/gcc/testsuite/c-c++-common/Wimplicit-fallthrough-23.c index c2988b7..01a4388 100644 --- a/gcc/testsuite/c-c++-common/Wimplicit-fallthrough-23.c +++ b/gcc/testsuite/c-c++-common/Wimplicit-fallthrough-23.c @@ -114,6 +114,12 @@ foo (int i) case 34: bar (34); break; + case 35: + bar (35); /* { dg-bogus "this statement may \[laf]* through" } */ + /* Else, fall-through. */ + case 36: + bar (36); + break; default: break; } @@ -225,6 +231,12 @@ foo (int i) case 34: bar (34); break; + case 35: + bar (35); /* { dg-bogus "this statement may \[laf]* through" } */ + // Else, fall-through + case 36: + bar (36); + break; default: break; } |