public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] c-family: Add -Wmisleading-indentation testcase [PR71637]
@ 2022-03-29 17:46 Patrick Palka
  0 siblings, 0 replies; only message in thread
From: Patrick Palka @ 2022-03-29 17:46 UTC (permalink / raw)
  To: gcc-patches

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-03-29 17:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-29 17:46 [committed] c-family: Add -Wmisleading-indentation testcase [PR71637] Patrick Palka

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).