C++ support questions

David Nolden zwabel at googlemail.com
Mon Feb 7 15:33:17 UTC 2011

2011/2/7 Esben Mose Hansen <kde at mosehansen.dk>:
> On Monday 07 February 2011 13:53:44 David Nolden wrote:
>> If the
>> namespace context was known, we could somehow pass it to the sub-job
>> (see sourceNeeded at preprocessjob.cpp:584). Maybe we could add some
>> ugly hack, to detect "namespace" prefixes without using the parser.
>> This is not nice though.
> And you would have the problem again when people decide to do something like
> class David_Rocks {
> #include "common_members.h"
> public:
> ...
> };
> If a crude hack should be made, perhaps it would be best to only divide the
> parsing of files when the includes are in the top-level scope? That is,
> between brackets the includes are simply inlined, then processed as a whole.
> Would that be possible?

Maybe this would be the best option. It would not be possible any more
to jump to the declarations and/or do refactoring on them, but that
would be an acceptable tradeoff. Fight uglyness with uglyness. :)

There currently is no working code to do this inline parsing though.
There might be some remainders of a similar thing from the starting
time of rpp.

Greetings, David

More information about the KDevelop-devel mailing list