c-lex.c (c_lex_with_flags): For CPP_COMMENT token with PREV_FALLTHROUGH...
authorJakub Jelinek <jakub@redhat.com>
Sat, 8 Oct 2016 10:48:54 +0000 (12:48 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Sat, 8 Oct 2016 10:48:54 +0000 (12:48 +0200)
commit7bad794aa005aa3ee52fc9c872051d8346c09a24
treedbcbde73147d32631dd626a01571e5964d9ff5fe
parent6dc29c6db124fab32ab9b69cfb283e078cc881fc
c-lex.c (c_lex_with_flags): For CPP_COMMENT token with PREV_FALLTHROUGH...

* c-lex.c (c_lex_with_flags) <case CPP_COMMENT>: For CPP_COMMENT
token with PREV_FALLTHROUGH, skip all following CPP_PADDING and
CPP_COMMENT tokens and set add_flags to PREV_FALLTHROUGH afterwards.

* doc/invoke.texi (-Wimplicit-fallthrough): Document the accepted
FALLTHRU comment styles.

* lex.c (fallthrough_comment_p): Fix off-by-one size comparison
errors, cleanup.
(_cpp_lex_direct): Allow arbitrary comments in between
fallthrough_comment_p comment and following token.

* c-c++-common/Wimplicit-fallthrough-23.c: New test.
* c-c++-common/Wimplicit-fallthrough-24.c: New test.

From-SVN: r240884
gcc/ChangeLog
gcc/c-family/ChangeLog
gcc/c-family/c-lex.c
gcc/doc/invoke.texi
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/Wimplicit-fallthrough-23.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/Wimplicit-fallthrough-24.c [new file with mode: 0644]
libcpp/ChangeLog
libcpp/lex.c