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, if function-like macros buried deep inside a macro expansion of the 11 // same name as an object-like macro do not eat up more tokens, than expected. 12 13 #define PRIMITIVE_CAT(a, b) a ## b 14 15 #define EAT(n) PRIMITIVE_CAT(EAT_, n) 16 #define EAT_1(a) 17 18 //R #line 20 "t_1_023.cpp" 19 //R EAT_1... 20 EAT(1)... 21 22 //H 10: t_1_023.cpp(13): #define 23 //H 08: t_1_023.cpp(13): PRIMITIVE_CAT(a, b)=a ## b 24 //H 10: t_1_023.cpp(15): #define 25 //H 08: t_1_023.cpp(15): EAT(n)=PRIMITIVE_CAT(EAT_, n) 26 //H 10: t_1_023.cpp(16): #define 27 //H 08: t_1_023.cpp(16): EAT_1(a)= 28 //H 00: t_1_023.cpp(20): EAT(1), [t_1_023.cpp(15): EAT(n)=PRIMITIVE_CAT(EAT_, n)] 29 //H 02: PRIMITIVE_CAT(EAT_, 1) 30 //H 00: t_1_023.cpp(15): PRIMITIVE_CAT(EAT_, 1), [t_1_023.cpp(13): PRIMITIVE_CAT(a, b)=a ## b] 31 //H 02: EAT_1 32 //H 03: EAT_1 33 //H 03: EAT_1 34