1 /*=============================================================================
2     Boost.Wave: A Standard compliant C++ preprocessor library
3     http://www.boost.org/
4 
5     Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
6     Software License, Version 1.0. (See accompanying file
7     LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8 =============================================================================*/
9 
10 // This sample is taken from the C++ standard 16.3.5.5 [cpp.scope]
11 
12 // Currently this test fails due to a pathologic border case, which is included
13 // here. Wave currently does not support expanding macros, where the
14 // replacement-list terminates in partial macro expansion (such as the
15 // definition of the macro h below). This will be fixed in a future release.
16 
17 #define x 3
18 #define f(a) f(x * (a))
19 #undef x
20 #define x 2
21 #define g f
22 #define z z[0]
23 #define h g( ~
24 #define m(a) a(w)
25 #define w 0,1
26 #define t(a) a
27 f(y+1) + f(f(z)) % t(t(g)(0) + t)(1);
28 g(x+(3,4)-w)
29 h 5) & m(f)^m(m);
30 
31 //R #line 27 "t_1_014.cpp"
32 //R f(2 * (y+1)) + f(2 * (f(2 * (z[0])))) % f(2 * (0)) + t(1);
33 //R f(2 * (2+(3,4)-0,1))
34 //E t_1_014.cpp(29): error: improperly terminated macro invocation or replacement-list terminates in partial macro expansion (not supported yet): missing ')'
35 // should expand to: f(2 * g( ~ 5)) & f(2 * (0,1))^m(0,1);
36