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 the correctness of parameter replacement, if the parameter is 11 // adjacent to an operator '##'. 12 13 #define CONCAT(a, b) PRIMITIVE_CONCAT(a, b) 14 #define PRIMITIVE_CONCAT(a, b) a ## b 15 16 //R #line 18 "t_1_006.cpp" 17 //R 123 18 CONCAT(1, PRIMITIVE_CONCAT(2, 3)) 19 //R #line 21 "t_1_006.cpp" 20 //R 123 21 CONCAT(1, CONCAT(2, 3)) 22 // E t_1_006.cpp(23): error: pasting the following two tokens does not give a valid preprocessing token: "1" and "CONCAT" 23 //R #line 25 "t_1_006.cpp" 24 //R 1 CONCAT(2, 3) 25 PRIMITIVE_CONCAT(1, CONCAT(2, 3)) 26 27 //H 10: t_1_006.cpp(13): #define 28 //H 08: t_1_006.cpp(13): CONCAT(a, b)=PRIMITIVE_CONCAT(a, b) 29 //H 10: t_1_006.cpp(14): #define 30 //H 08: t_1_006.cpp(14): PRIMITIVE_CONCAT(a, b)=a ## b 31 //H 00: t_1_006.cpp(18): CONCAT(1, PRIMITIVE_CONCAT(2, 3)), [t_1_006.cpp(13): CONCAT(a, b)=PRIMITIVE_CONCAT(a, b)] 32 //H 00: t_1_006.cpp(18): PRIMITIVE_CONCAT(2, 3), [t_1_006.cpp(14): PRIMITIVE_CONCAT(a, b)=a ## b] 33 //H 02: 23 34 //H 03: 23 35 //H 02: PRIMITIVE_CONCAT(1, 23) 36 //H 00: t_1_006.cpp(13): PRIMITIVE_CONCAT(1, 23), [t_1_006.cpp(14): PRIMITIVE_CONCAT(a, b)=a ## b] 37 //H 02: 123 38 //H 03: 123 39 //H 03: 123 40 //H 00: t_1_006.cpp(21): CONCAT(1, CONCAT(2, 3)), [t_1_006.cpp(13): CONCAT(a, b)=PRIMITIVE_CONCAT(a, b)] 41 //H 00: t_1_006.cpp(21): CONCAT(2, 3), [t_1_006.cpp(13): CONCAT(a, b)=PRIMITIVE_CONCAT(a, b)] 42 //H 02: PRIMITIVE_CONCAT(2, 3) 43 //H 00: t_1_006.cpp(13): PRIMITIVE_CONCAT(2, 3), [t_1_006.cpp(14): PRIMITIVE_CONCAT(a, b)=a ## b] 44 //H 02: 23 45 //H 03: 23 46 //H 03: 23 47 //H 02: PRIMITIVE_CONCAT(1, 23) 48 //H 00: t_1_006.cpp(13): PRIMITIVE_CONCAT(1, 23), [t_1_006.cpp(14): PRIMITIVE_CONCAT(a, b)=a ## b] 49 //H 02: 123 50 //H 03: 123 51 //H 03: 123 52 //H 00: t_1_006.cpp(25): PRIMITIVE_CONCAT(1, CONCAT(2, 3)), [t_1_006.cpp(14): PRIMITIVE_CONCAT(a, b)=a ## b] 53 //H 02: 1CONCAT(2, 3) 54 //H 03: 1CONCAT(2, 3) 55