t_1_023.cpp 1.2 KB

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