diff mbox series

[committed] c-family: Add -Wmisleading-indentation testcase [PR71637]

Message ID 20220329174603.177011-1-ppalka@redhat.com
State New
Headers show
Series [committed] c-family: Add -Wmisleading-indentation testcase [PR71637] | expand

Commit Message

Patrick Palka March 29, 2022, 5:46 p.m. UTC
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 mbox series

Patch

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;
+}