https://gcc.gnu.org/g:625d5776f9cd0b09512d7b5e403737ad944f33d3

commit r16-2725-g625d5776f9cd0b09512d7b5e403737ad944f33d3
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Sun Aug 3 18:32:19 2025 +0200

    c++: Add stringification testcase for CWG1709 [PR120778]
    
    The CWG1709 just codifies existing GCC (and clang) behavior, so this
    just adds a testcase for that.
    
    2025-08-03  Jakub Jelinek  <ja...@redhat.com>
    
            PR preprocessor/120778
            * g++.dg/DRs/dr1709.C: New test.

Diff:
---
 gcc/testsuite/g++.dg/DRs/dr1709.C | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/gcc/testsuite/g++.dg/DRs/dr1709.C 
b/gcc/testsuite/g++.dg/DRs/dr1709.C
new file mode 100644
index 000000000000..d3854d8da1aa
--- /dev/null
+++ b/gcc/testsuite/g++.dg/DRs/dr1709.C
@@ -0,0 +1,18 @@
+// DR 1709 - Stringizing raw string literals containing newline
+// { dg-do run { target c++26 } }
+
+#define A(a) #a
+const char *a = A(a\f\\b"c");
+const char *b = A(R"abc(a\b
+
+)abc");
+
+int
+main ()
+{
+  if (a[1] != '\f' || a[2] != '\\' || a[4] != '"' || a[6] != '"')
+    __builtin_abort ();
+  if (b[1] != '"' || b[7] != '\\' || b[9] != '\n' || b[10] != '\n'
+      || b[11] != ')' || b[15] != '"')
+    __builtin_abort ();
+}

Reply via email to