t_9_003.cpp 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. // Test, if additional whitespace is inserted at appropriate places.
  9. #define STRINGIZE(x) STRINGIZE_D(x)
  10. #define STRINGIZE_D(x) #x
  11. #define X() 1
  12. #define PLUS() +
  13. #define MINUS() -
  14. #define DOT() .
  15. #define GREATER() >
  16. #define LESS() <
  17. //R #line 23 "t_9_003.cpp"
  18. X()2 //R 1 2
  19. STRINGIZE( X()2 ) //R "12"
  20. //R
  21. X() 2 //R 1 2
  22. STRINGIZE( X() 2 ) //R "1 2"
  23. //R
  24. PLUS()MINUS() //R +-
  25. STRINGIZE( PLUS()MINUS() ) //R "+-"
  26. //R
  27. PLUS()PLUS() //R + +
  28. STRINGIZE( PLUS()PLUS() ) //R "++"
  29. //R
  30. MINUS()MINUS() //R - -
  31. STRINGIZE( MINUS()MINUS() ) //R "--"
  32. //R
  33. DOT()DOT()DOT() //R .. .
  34. STRINGIZE( DOT()DOT()DOT() ) //R "..."
  35. // the following are regressions reported by Stefan Seefeld
  36. //R #line 43 "t_9_003.cpp"
  37. GREATER()GREATER() //R > >
  38. STRINGIZE( GREATER()GREATER() ) //R ">>"
  39. //R
  40. LESS()LESS() //R < <
  41. STRINGIZE( LESS()LESS() ) //R "<<"
  42. #define COMMA() ,
  43. #define AND() &
  44. #define CHAR() char
  45. #define STAR() *
  46. // Make sure no whitespace gets inserted in between the operator symbols
  47. //R #line 56 "t_9_003.cpp"
  48. void foo(char&, char) //R void foo(char&, char)
  49. void foo(char *) //R void foo(char *)
  50. void foo(char *&) //R void foo(char *&)
  51. void foo(CHAR()AND()COMMA() CHAR()) //R void foo(char&, char)
  52. void foo(CHAR() STAR()) //R void foo(char *)
  53. void foo(CHAR() STAR()AND()) //R void foo(char *&)