From: David Malcolm <dmalcolm@redhat.com>
To: gcc-patches@gcc.gnu.org
Cc: David Malcolm <dmalcolm@redhat.com>
Subject: [committed 1/2] Wmisleading-indentation: add reproducer for PR c/70085
Date: Fri, 11 Mar 2016 20:05:00 -0000 [thread overview]
Message-ID: <1457728075-11443-1-git-send-email-dmalcolm@redhat.com> (raw)
In-Reply-To: <1457020600.1637.29.camel@redhat.com>
PR c/70085 reported a false-positive from -Wmisleading-indentation.
The warning was fixed by the fix for PR c/68187 (r233972), but it seems
worth capturing the reproducer for PR c/70085 as an additional test case,
as it's slightly different to those seen in PR c/68187.
Committed to trunk (as "obvious") as r234145.
gcc/testsuite/ChangeLog:
PR c/70085
* c-c++-common/Wmisleading-indentation.c (pr70085): New test case.
---
gcc/testsuite/c-c++-common/Wmisleading-indentation.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/gcc/testsuite/c-c++-common/Wmisleading-indentation.c b/gcc/testsuite/c-c++-common/Wmisleading-indentation.c
index 7b499d4..38c8aec 100644
--- a/gcc/testsuite/c-c++-common/Wmisleading-indentation.c
+++ b/gcc/testsuite/c-c++-common/Wmisleading-indentation.c
@@ -1054,3 +1054,19 @@ fn_42_c (int locked, int i)
return 0;
#undef engine_ref_debug
}
+
+/* We shouldn't complain about the following function. */
+#define ENABLE_FEATURE
+int pr70085 (int x, int y)
+{
+ if (x > y)
+ return x - y;
+
+ #ifdef ENABLE_FEATURE
+ if (x == y)
+ return 0;
+ #endif
+
+ return -1;
+}
+#undef ENABLE_FEATURE
--
1.8.5.3
next prev parent reply other threads:[~2016-03-11 20:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-03 14:58 [PATCH 1/2] PR c/68187: fix overzealous -Wmisleading-indentation (comment #0) David Malcolm
2016-03-03 14:58 ` [PATCH 2/2] PR c/68187: fix overzealous -Wmisleading-indentation (comment #1) David Malcolm
2016-03-03 17:16 ` Patrick Palka
2016-03-04 12:53 ` Bernd Schmidt
2016-03-04 13:05 ` Marek Polacek
2016-03-04 7:20 ` Jeff Law
2016-03-03 15:25 ` [PATCH 1/2] PR c/68187: fix overzealous -Wmisleading-indentation (comment #0) Patrick Palka
2016-03-03 15:56 ` David Malcolm
2016-03-03 16:58 ` Patrick Palka
2016-03-11 20:05 ` David Malcolm [this message]
2016-03-11 20:05 ` [committed 2/2] Wmisleading-indentation.c: add more test cases for PR c/68187 David Malcolm
2016-03-04 7:15 ` [PATCH 1/2] PR c/68187: fix overzealous -Wmisleading-indentation (comment #0) Jeff Law
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1457728075-11443-1-git-send-email-dmalcolm@redhat.com \
--to=dmalcolm@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).