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 // Tests delayed macro expansion (rescanning) 11 12 #define CONCAT_1(A, B) A ## B 13 #define CONCAT_2(A, B) CONCAT_1(A, B) 14 15 #define DELAY(NAME) NAME 16 17 #define A1 a 18 #define B1 b 19 20 #define A2() a 21 #define B2() b 22 23 #define LHS ( 24 #define RHS ) 25 26 //R #line 27 "t_1_027.cpp" 27 DELAY(CONCAT_1)( a, b ) (); //R ab (); 28 DELAY(CONCAT_1)(A1, B1)(); //R A1B1(); 29 DELAY(CONCAT_1) LHS A1, B1 RHS (); //R CONCAT_1 ( a, b )(); 30 CONCAT_1 ( a, b ) (); //R ab (); 31 CONCAT_1 ( A1, B1 ) (); //R A1B1 (); 32 CONCAT_1 LHS a, b RHS (); //R CONCAT_1 ( a, b )(); 33 //R 34 DELAY(CONCAT_2)( a, b ) (); //R ab (); 35 DELAY(CONCAT_2)(A1, B1)(); //R ab(); 36 DELAY(CONCAT_2) LHS A1, B1 RHS (); //R CONCAT_2 ( a, b )(); 37 DELAY(CONCAT_2)(A2(), B2())(); //R ab(); 38 CONCAT_2 ( a, b ) (); //R ab (); 39 CONCAT_2 ( A1, B1 ) (); //R ab (); 40 CONCAT_2 LHS a, b RHS (); //R CONCAT_2 ( a, b )(); 41 CONCAT_2(A2(), B2())(); //R ab(); 42