[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / Preprocessor / macro_vaopt_p1042r1.cpp
blobf12dd20b82113207c47a39b5260a51d12f39172d
1 RUN: %clang_cc1 -E %s -pedantic -std=c++2a | FileCheck -strict-whitespace %s
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;
9 #define F2(...) f(0 __VA_OPT__(,) __VA_ARGS__)
10 #define EMP
11 2: F2(EMP)
12 // CHECK: 2: f(0 )
14 #define H3(X, ...) #__VA_OPT__(X##X X##X)
15 3: H3(, 0)
16 // CHECK: 3: ""
18 #define H4(X, ...) __VA_OPT__(a X ## X) ## b
19 4: H4(, 1)
20 // CHECK: 4: a b
22 #define H4B(X, ...) a ## __VA_OPT__(X ## X b)
23 4B: H4B(, 1)
24 // CHECK: 4B: a b
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