c++: Test for whitespace and line splice
authorJason Merrill <jason@redhat.com>
Tue, 8 Jun 2021 18:32:42 +0000 (14:32 -0400)
committerJason Merrill <jason@redhat.com>
Tue, 8 Jun 2021 19:34:43 +0000 (15:34 -0400)
From wg21.link/P2223R2

gcc/testsuite/ChangeLog:

* g++.dg/cpp23/whitespace-splice1.C: New test.

gcc/testsuite/g++.dg/cpp23/whitespace-splice1.C [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.dg/cpp23/whitespace-splice1.C b/gcc/testsuite/g++.dg/cpp23/whitespace-splice1.C
new file mode 100644 (file)
index 0000000..f115ce0
--- /dev/null
@@ -0,0 +1,15 @@
+// Tests from P2223R2
+// { dg-additional-options -w }
+// { dg-do compile { target c++11 } }
+
+constexpr auto str = "\ 
+";
+
+static_assert(__builtin_strlen(str) == 0, "");
+
+constexpr int i = 1
+  // \ 
+  + 42
+  ;
+
+static_assert(i == 1, "");