blob: 3886c8db9e286b5dc8ba2afedd0e0249af452e3d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
// macro-parens-from-expansion.slang
//DIAGNOSTIC_TEST:SIMPLE:-E
// This test covers a case where the parentheses for
// a function-like macro invocation argument list are
// themselves produced by a macro invocation.
//
// In the below code, it is important that the macros
// `LPAREN` and `RPAREN` are not considered busy for
// the invocation of `INNER`, despite the fact that
// both of those macros were expanded as part of
// producing the arguments to the `INNER` invocation.
#define LPAREN (
#define RPAREN )
#define INNER(X) LPAREN X RPAREN
#define M(X) X
#define OUTER(X) M( INNER LPAREN X RPAREN )
// output: ( 3 )
OUTER(3)
|