C++ preprocessor patch - need help to finish

Dmitry Risenberg dmitry.risenberg at gmail.com
Fri Nov 19 22:25:05 UTC 2010

Hi all!

I have written a patch that fixes the cpp preprocessor behaviour (see
https://bugs.kde.org/show_bug.cgi?id=256433). The main change is that
now the parameters in macro body are replaced before a recursive macro
expansion takes place, as it should be, according to the standard.
Unfortunately, this has broken some unit tests in
languages/cpp/parser/tests/test_cppcodecompletion.cpp that deal with
locations of declarations. As I see it, that is because parameter
replacement and recursive macro expansion are done it two separate
steps now (see pp-macro-expander.cpp, lines 567-573 in patched
version), and all info about location of replaced parameters is lost
between them. So I need a way to pass the location info to the second
step somehow, but couldn't figure out how to do it - the whole
position-related stuff seems complicated. I'd appreciate some help to
finish this thing.

Dmitry Risenberg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kdevelop-preprocessor.patch
Type: application/octet-stream
Size: 15386 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20101120/f39f5ed3/attachment.obj>

More information about the KDevelop-devel mailing list