www.digitalmars.com         C & C++   DMDScript  

c++ - [Bug report] Tokens that are not separated by whitespace concatenate

This bug is not very important, it doesn't cause any problems with the 
boost preprocessor library. It's just something I stumbled across that 
could potentially cause problems.

     #define FOO(x) x

     FOO(1)1

This expands to '11' when it should expand to '1 1'.

I believe that internally the two 1's should be stored as separate but 
adjacent tokens, then, if converted to text, the whitespace should be 
inserted to show that they are separate. But I'm not an expert on this, 
and I don't have a copy of the standard to check, so there's a good 
chance that I could be wrong.

As before, I've attached some relevant tests from wave.

Daniel
Aug 12 2004