aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-family/c-indentation.c
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2016-03-22 14:20:49 +0000
committerDavid Malcolm <dmalcolm@gcc.gnu.org>2016-03-22 14:20:49 +0000
commit5c240f4db3d1a9dc5503e566ec9ab8cbe26d6f3a (patch)
tree4ec7a98191c5579ee965a5da16e54b282da5cc8d /gcc/c-family/c-indentation.c
parent80f6631ba04be3d07df968ed338a98b4dc65d0ac (diff)
downloadgcc-5c240f4db3d1a9dc5503e566ec9ab8cbe26d6f3a.zip
gcc-5c240f4db3d1a9dc5503e566ec9ab8cbe26d6f3a.tar.gz
gcc-5c240f4db3d1a9dc5503e566ec9ab8cbe26d6f3a.tar.bz2
PR c/69993: improvements to wording of -Wmisleading-indentation
gcc/c-family/ChangeLog: PR c/69993 * c-indentation.c (warn_for_misleading_indentation): Rewrite the diagnostic text, reversing the order of the warning and note so that they appear in source order. gcc/testsuite/ChangeLog: PR c/69993 * c-c++-common/Wmisleading-indentation-3.c: New test, based on Wmisleading-indentation.c. * c-c++-common/Wmisleading-indentation.c: Update thoughout to reflect change to diagnostic text and order of messages. * gcc.dg/plugin/location-overflow-test-2.c: Likewise. From-SVN: r234403
Diffstat (limited to 'gcc/c-family/c-indentation.c')
-rw-r--r--gcc/c-family/c-indentation.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/c-family/c-indentation.c b/gcc/c-family/c-indentation.c
index b84fbf4..1da3f68 100644
--- a/gcc/c-family/c-indentation.c
+++ b/gcc/c-family/c-indentation.c
@@ -602,10 +602,12 @@ warn_for_misleading_indentation (const token_indent_info &guard_tinfo,
body_tinfo,
next_tinfo))
{
- if (warning_at (next_tinfo.location, OPT_Wmisleading_indentation,
- "statement is indented as if it were guarded by..."))
- inform (guard_tinfo.location,
- "...this %qs clause, but it is not",
+ if (warning_at (guard_tinfo.location, OPT_Wmisleading_indentation,
+ "this %qs clause does not guard...",
+ guard_tinfo_to_string (guard_tinfo)))
+ inform (next_tinfo.location,
+ ("...this statement, but the latter is misleadingly indented"
+ " as if it is guarded by the %qs"),
guard_tinfo_to_string (guard_tinfo));
}
}