aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Palka <ppalka@redhat.com>2022-03-29 13:44:05 -0400
committerPatrick Palka <ppalka@redhat.com>2022-03-29 13:44:05 -0400
commit89976d082488b3a7dc7520b980f854ce83043d38 (patch)
treef04465bdac6a44a58cf4eb2ed74523cada15f905
parent9f9ccc4a5788fc6afbb4fb2d56ad20dde28f0de5 (diff)
downloadgcc-89976d082488b3a7dc7520b980f854ce83043d38.zip
gcc-89976d082488b3a7dc7520b980f854ce83043d38.tar.gz
gcc-89976d082488b3a7dc7520b980f854ce83043d38.tar.bz2
c-family: Add -Wmisleading-indentation testcase [PR71637]
We no longer emit a bogus warning for the below testcase after r11-3266-g4839de55e2c986. PR c++/71637 gcc/testsuite/ChangeLog: * c-c++-common/Wmisleading-indentation-6.c: New test.
-rw-r--r--gcc/testsuite/c-c++-common/Wmisleading-indentation-6.c11
1 files changed, 11 insertions, 0 deletions
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 0000000..5b7dd7f
--- /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;
+}