Skip to content

Commit 625d577

Browse files
committed
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 <[email protected]> PR preprocessor/120778 * g++.dg/DRs/dr1709.C: New test.
1 parent a68f416 commit 625d577

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

gcc/testsuite/g++.dg/DRs/dr1709.C

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// DR 1709 - Stringizing raw string literals containing newline
2+
// { dg-do run { target c++26 } }
3+
4+
#define A(a) #a
5+
const char *a = A(a\f\\b"c");
6+
const char *b = A(R"abc(a\b
7+
8+
)abc");
9+
10+
int
11+
main ()
12+
{
13+
if (a[1] != '\f' || a[2] != '\\' || a[4] != '"' || a[6] != '"')
14+
__builtin_abort ();
15+
if (b[1] != '"' || b[7] != '\\' || b[9] != '\n' || b[10] != '\n'
16+
|| b[11] != ')' || b[15] != '"')
17+
__builtin_abort ();
18+
}

0 commit comments

Comments
 (0)