We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 36f751e commit 52bc5dbCopy full SHA for 52bc5db
clang/test/Preprocessor/cxx_oper_comma.cpp
@@ -10,7 +10,9 @@
10
#if 1, 2
11
#endif
12
13
-// Test 2: Comma in conditional expression
+// Test 2: Comma in conditional expression(CWG3017)
14
+// Per CWG 3017, this exact case highlights the specification gap
15
+// where C++ lacks explicit prohibition of comma operators in #if
16
// expected-error@+1 {{comma operator in operand of #if}}
17
#if 1 ? 1, 0 : 3
18
@@ -24,3 +26,8 @@
24
26
// expected-error@+1 {{expected end of line in preprocessor expression}}
25
27
#if 1, 2, 3
28
29
+
30
+// Test 5: Comma in #elif
31
+#if 0
32
+#elif (1, 2) // expected-error {{comma operator in operand of #if}}
33
+#endif
0 commit comments