t_1_027.cpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*=============================================================================
  2. Boost.Wave: A Standard compliant C++ preprocessor library
  3. http://www.boost.org/
  4. Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
  5. Software License, Version 1.0. (See accompanying file
  6. LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  7. =============================================================================*/
  8. // Tests delayed macro expansion (rescanning)
  9. #define CONCAT_1(A, B) A ## B
  10. #define CONCAT_2(A, B) CONCAT_1(A, B)
  11. #define DELAY(NAME) NAME
  12. #define A1 a
  13. #define B1 b
  14. #define A2() a
  15. #define B2() b
  16. #define LHS (
  17. #define RHS )
  18. //R #line 27 "t_1_027.cpp"
  19. DELAY(CONCAT_1)( a, b ) (); //R ab ();
  20. DELAY(CONCAT_1)(A1, B1)(); //R A1B1();
  21. DELAY(CONCAT_1) LHS A1, B1 RHS (); //R CONCAT_1 ( a, b )();
  22. CONCAT_1 ( a, b ) (); //R ab ();
  23. CONCAT_1 ( A1, B1 ) (); //R A1B1 ();
  24. CONCAT_1 LHS a, b RHS (); //R CONCAT_1 ( a, b )();
  25. //R
  26. DELAY(CONCAT_2)( a, b ) (); //R ab ();
  27. DELAY(CONCAT_2)(A1, B1)(); //R ab();
  28. DELAY(CONCAT_2) LHS A1, B1 RHS (); //R CONCAT_2 ( a, b )();
  29. DELAY(CONCAT_2)(A2(), B2())(); //R ab();
  30. CONCAT_2 ( a, b ) (); //R ab ();
  31. CONCAT_2 ( A1, B1 ) (); //R ab ();
  32. CONCAT_2 LHS a, b RHS (); //R CONCAT_2 ( a, b )();
  33. CONCAT_2(A2(), B2())(); //R ab();