Skip to content

Commit 728f872

Browse files
committed
Add test for #embed limit as a constant expression
1 parent 1c32551 commit 728f872

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

clang/test/Preprocessor/cxx_oper_comma.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
// RUN: %clang_cc1 -E -pedantic-errors %s -verify -std=c++14
44
// RUN: %clang_cc1 -E -pedantic-errors %s -verify -std=c++17
55
// RUN: %clang_cc1 -E -pedantic-errors %s -verify -std=c++20
6-
// RUN: %clang_cc1 -E -pedantic-errors %s -verify -std=c++23
6+
// RUN: %clang_cc1 -E -pedantic-errors %s -verify=expected,embed -std=c++23 -Wno-c23-extensions
7+
// RUN: %clang_cc1 -E -pedantic-errors %s -verify=expected,embed -std=c++2c -Wno-c23-extensions
78

89
// Test 1: Top-level comma
910
// expected-error@+1 {{expected end of line in preprocessor expression}}
@@ -35,4 +36,10 @@
3536
// Test 6: Leading comma (syntax error)
3637
// expected-error@+1 {{invalid token at start of a preprocessor expression}}
3738
#if ,
39+
#endif
40+
41+
// Test 7: Comma in #embed limit parameter (C++23+)
42+
#if defined(__has_embed) && __cplusplus >= 202302L
43+
// embed-error@+1 {{expected ')'}}
44+
#embed "jk.txt" limit(1, 2)
3845
#endif

0 commit comments

Comments
 (0)