t_1_028.cpp 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. //O --variadics
  10. #define CONCAT_1(A, B) A ## B
  11. #define CONCAT_2(A, B) CONCAT_1(A, B)
  12. #define DELAY(NAME) NAME
  13. #define A1 a
  14. #define B1 b
  15. #define A2() a
  16. #define B2() b
  17. #define LHS (
  18. #define RHS )
  19. //R #line 29 "t_1_028.cpp"
  20. DELAY(CONCAT_1)( a, b ) (); //R ab ();
  21. DELAY(CONCAT_1)(A1, B1)(); //R A1B1();
  22. DELAY(CONCAT_1) LHS A1, B1 RHS (); //R CONCAT_1 ( a, b )();
  23. DELAY(CONCAT_1)(A2(), B2())(); //R a b();
  24. CONCAT_1 ( a, b ) (); //R ab ();
  25. CONCAT_1 ( A1, B1 ) (); //R A1B1 ();
  26. CONCAT_1 LHS a, b RHS (); //R CONCAT_1 ( a, b )();
  27. CONCAT_1(A2(), B2())(); //R a b();
  28. //R
  29. DELAY(CONCAT_2)( a, b ) (); //R ab ();
  30. DELAY(CONCAT_2)(A1, B1)(); //R ab();
  31. DELAY(CONCAT_2) LHS A1, B1 RHS (); //R CONCAT_2 ( a, b )();
  32. DELAY(CONCAT_2)(A2(), B2())(); //R ab();
  33. CONCAT_2 ( a, b ) (); //R ab ();
  34. CONCAT_2 ( A1, B1 ) (); //R ab ();
  35. CONCAT_2 LHS a, b RHS (); //R CONCAT_2 ( a, b )();
  36. CONCAT_2(A2(), B2())(); //R ab();