150
|
1 RUN: %clang_cc1 -E %s -pedantic -std=c++2a | FileCheck -strict-whitespace %s
|
|
2
|
|
3 #define LPAREN() (
|
|
4 #define G(Q) 42
|
|
5 #define F1(R, X, ...) __VA_OPT__(G R X) )
|
|
6 1: int x = F1(LPAREN(), 0, <:-);
|
|
7 // CHECK: 1: int x = 42;
|
|
8
|
|
9 #define F2(...) f(0 __VA_OPT__(,) __VA_ARGS__)
|
|
10 #define EMP
|
|
11 2: F2(EMP)
|
|
12 // CHECK: 2: f(0 )
|
|
13
|
|
14 #define H3(X, ...) #__VA_OPT__(X##X X##X)
|
|
15 3: H3(, 0)
|
|
16 // CHECK: 3: ""
|
|
17
|
|
18 #define H4(X, ...) __VA_OPT__(a X ## X) ## b
|
|
19 4: H4(, 1)
|
|
20 // CHECK: 4: a b
|
|
21
|
|
22 #define H4B(X, ...) a ## __VA_OPT__(X ## X b)
|
|
23 4B: H4B(, 1)
|
|
24 // CHECK: 4B: a b
|
|
25
|
|
26 #define H5A(...) __VA_OPT__()/**/__VA_OPT__()
|
|
27 #define H5B(X) a ## X ## b
|
|
28 #define H5C(X) H5B(X)
|
|
29 5: H5C(H5A())
|
|
30 // CHECK: 5: ab
|