t_1_014.cpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  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. // This sample is taken from the C++ standard 16.3.5.5 [cpp.scope]
  9. // Currently this test fails due to a pathologic border case, which is included
  10. // here. Wave currently does not support expanding macros, where the
  11. // replacement-list terminates in partial macro expansion (such as the
  12. // definition of the macro h below). This will be fixed in a future release.
  13. #define x 3
  14. #define f(a) f(x * (a))
  15. #undef x
  16. #define x 2
  17. #define g f
  18. #define z z[0]
  19. #define h g( ~
  20. #define m(a) a(w)
  21. #define w 0,1
  22. #define t(a) a
  23. f(y+1) + f(f(z)) % t(t(g)(0) + t)(1);
  24. g(x+(3,4)-w)
  25. h 5) & m(f)^m(m);
  26. //R #line 27 "t_1_014.cpp"
  27. //R f(2 * (y+1)) + f(2 * (f(2 * (z[0])))) % f(2 * (0)) + t(1);
  28. //R f(2 * (2+(3,4)-0,1))
  29. //E t_1_014.cpp(29): error: improperly terminated macro invocation or replacement-list terminates in partial macro expansion (not supported yet): missing ')'
  30. // should expand to: f(2 * g( ~ 5)) & f(2 * (0,1))^m(0,1);