Community
Participate
Working Groups
In: #define FOO(/*(1)*/ a /*(2)*/, /*(3)*/ b /*(4)*/) a + b the offset for a points to '/' (from /*(1)*/). b has the same problem. It's caused by ASTFunctionStyleMacroDefinition.getParameters() working with char[] image= getRawSignatureChars(); and only skipping whitespace, but not comments. This seems to be a bigger problem even. This definition can't be parsed by CDT at all: #define FOO(/*(1)*/ a /*(2)*/, /*(3)*/ b /*(4)*/) "/*(5)*/" a + b This reports a syntax error.
(In reply to Marco Trudel from comment #0) > This seems to be a bigger problem even. This definition can't be parsed by > CDT at all: #define FOO(/*(1)*/ a /*(2)*/, /*(3)*/ b /*(4)*/) "/*(5)*/" a + b > This reports a syntax error. I don't see a syntax error with the latest CDT.
Created attachment 248656 [details] testcase that shows the bug (standalone program)
Comment on attachment 248656 [details] testcase that shows the bug (standalone program) Actual Output ------------- Parameters of "OK(a,b)=a + b": - a - b Parameters of "FAILS(a,b)=a + b": - / - / Expected Output --------------- Parameters of "OK(a,b)=a + b": - a - b Parameters of "FAILS(a,b)=a + b": - a - b
(In reply to Nathan Ridge from comment #1) > (In reply to Marco Trudel from comment #0) > > This seems to be a bigger problem even. This definition can't be parsed by > > CDT at all: #define FOO(/*(1)*/ a /*(2)*/, /*(3)*/ b /*(4)*/) "/*(5)*/" a + b > > This reports a syntax error. > > I don't see a syntax error with the latest CDT. Sorry, there's actually no syntax error. I must have gotten confused when trying to work around that bug for too long. I now added a small testcase that shows the bug.