PR c/68187: fix overzealous -Wmisleading-indentation (comment #0)
authordmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 4 Mar 2016 15:45:19 +0000 (15:45 +0000)
committerdmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 4 Mar 2016 15:45:19 +0000 (15:45 +0000)
commit74c6fd40a953e2ad1657d06946994d51ec8a64e0
tree437b3b6b9215076f13844d2bc99227445a912367
parent31b1135939e123d84a548e433892eff6c1818a63
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@233971 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/c-family/ChangeLog
gcc/c-family/c-indentation.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/Wmisleading-indentation.c