PR c/68187: fix overzealous -Wmisleading-indentation (comment #0)
commit729526f5d4399d141458ca0026490a1231149338
authorDavid Malcolm <dmalcolm@redhat.com>
Fri, 4 Mar 2016 15:45:19 +0000 (4 15:45 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Fri, 4 Mar 2016 15:45:19 +0000 (4 15:45 +0000)
tree437b3b6b9215076f13844d2bc99227445a912367
parentf9ea11ac194e5129ff90145a73b91b08a244174b
PR c/68187: fix overzealous -Wmisleading-indentation (comment #0)

gcc/c-family/ChangeLog:
PR c/68187
* c-indentation.c (should_warn_for_misleading_indentation): When
suppressing warnings about cases where the guard and body are on
the same column, only use the first non-whitespace column in place
of the guard token column when dealing with "else" clauses.
When rejecting aligned BODY and NEXT, loosen the requirement
from equality with the first non-whitespace of guard to simply
that they not be indented relative to it.

gcc/testsuite/ChangeLog:
PR c/68187
* c-c++-common/Wmisleading-indentation.c (fn_40_a): New test
function.
(fn_40_b): Likewise.
(fn_41_a): Likewise.
(fn_41_b): Likewise.

From-SVN: r233971
gcc/c-family/ChangeLog
gcc/c-family/c-indentation.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/Wmisleading-indentation.c