public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Patrick Palka <ppalka@redhat.com>
To: gcc-patches@gcc.gnu.org
Subject: [committed] c-family: Add -Wmisleading-indentation testcase [PR71637]
Date: Tue, 29 Mar 2022 13:46:03 -0400	[thread overview]
Message-ID: <20220329174603.177011-1-ppalka@redhat.com> (raw)

We no longer emit a bogus warning for the below testcase after
r11-3266-g4839de55e2c986.

Tested on x86_64-pc-linux-gnu, committed to trunk as obvious.

	PR c++/71637

gcc/testsuite/ChangeLog:

	* c-c++-common/Wmisleading-indentation-6.c: New test.
---
 .../c-c++-common/Wmisleading-indentation-6.c          | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100644 gcc/testsuite/c-c++-common/Wmisleading-indentation-6.c

diff --git a/gcc/testsuite/c-c++-common/Wmisleading-indentation-6.c b/gcc/testsuite/c-c++-common/Wmisleading-indentation-6.c
new file mode 100644
index 00000000000..5b7dd7fd2fd
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/Wmisleading-indentation-6.c
@@ -0,0 +1,11 @@
+/* PR c++/71637  */
+/* { dg-options "-ftrack-macro-expansion=0 -Wmisleading-indentation" }  */
+
+#define m(x) ({ int y; if (x) y=0; else y=1; y; })
+
+int main()
+{
+  int x =
+    m(0);
+  return x;
+}
-- 
2.35.1.677.gabf474a5dd


                 reply	other threads:[~2022-03-29 17:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220329174603.177011-1-ppalka@redhat.com \
    --to=ppalka@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).