Community
Participate
Working Groups
There are two problems in the test case: 1. Macro expansion of operator ## with hex literal-like "0xxyz" causes the parser to ignore the expansion. 2. Macro expansion where macroname is the same as one of its arguments. see below, #define C(X,Y) X##Y int C(A,1Xxyz) = 10; int C(B,1X1X1Xxyz) = 20; int C(C,0Xxyz) = 30; // macro expansion is NOT OK int C(CC,0Xxyz) = 30; // OK int C(D,0xxyz) = 40; // macro expansion is NOT OK int C(E,0x0x0xxyz) = 50;
Created attachment 10756 [details] test case
The resultant outline view is as follows: A1Xxyz : int B1X1X1Xxyz : int CC0Xxyz : int Dxyz : int E0x0x0xxyz : int As you can see, C0Xxyz is missing and D0xxyz is coming out as Dxyz.
Update: The problem is that when we lookahead for macro pasting, we are expecting a valid token. 0xxyz is not a valid identifier format, or a valid hexidecimal integer format, and thus it causes an error. Mr. Niefer, as the originator of this strategy, do you have any suggestions as to how we can get past this?
PR was targeted to the 2.0 release but not resolved, moving target to 2.1
This is a 2.0.1 candidate.
This defect is fixed in HEAD w/Scanner2 implementation. It shall be marked as resolved once it has been fixed in 2.0.1 as well.
The merge from HEAD to 2_0 branch is complete. JUnits validating these fixes have been committed to both branches. Marking as RESOLVED - FIXED. The next available 2.0.1 build shall contain these fixes along with Parser performance/scalability improvements.