Indexing C++ classes in namespaces [message #205234] |
Tue, 20 November 2007 08:11  |
Eclipse User |
|
|
|
Originally posted by: max.pfingsthorn.gmail.com
Dear all,
I have a little trouble with the indexer. It doesn't seem to index
classes in namespaces consistently. Sometimes it works, sometimes it
doesn't. I had a look at the C++ Index view to see what has been indexed
and what hasn't. I'm 100% sure that all my headers and sources are in
the designated source folders. Not sure what else to do.
Can you tell me if this is a general problem or could it have something
to do with my configuration?
Thank you!
max
|
|
|
Re: Indexing C++ classes in namespaces [message #205430 is a reply to message #205234] |
Fri, 23 November 2007 11:20   |
Eclipse User |
|
|
|
Originally posted by: raimund.berger.nowhere.com.org.dot.com.org
No help on this but rather seconded. The parser generally really does a
great job at unriddling code, but I have a case where it apparently fails
with namespaces introduced through preprocessor macros.
More specifically, I evaluated the parser features on a very modest size
app framework called Juce (http://www.rawmaterialsoftware.com/juce/) where
framework definitions are wrapped into a namespace called 'juce' mainly
through preprocessor macros.
User code is then required to include a header "juce.h", which contains a
macro expanding to "using namespace juce;", so that user code doesn't
need to qualify the namespace itself. Example:
#include <juce.h>
class test : public ChangeListener
{
// user code ...
};
where ChangeListener is a framework class and actually
juce::ChangeListener .
Now, this compiles OK with a managed build because the header contains
that "using namespace juce;" statement after preprocessing/macro
expansion, but the cdt parser/indexer fails on this. E.g. trying to show
the ChangeListener class in the type hierarchy view gives an error.
On the other hand, if I explicitly enter a "using" statement
#include <juce.h>
using namespace juce;
...
all works well.
I tested the correct juce.h header expansion by just copying the g++
command line from the eclipse C++ build settings and replacing the "-c"
command parameter with an "-E", so it's not an include path/whatever issue.
Greetings, Raimund.
Eclipse Europa
Eclipse Version: 3.3.1.1
Build id: M20071023-1652
|
|
|
|
Re: Indexing C++ classes in namespaces [message #205446 is a reply to message #205438] |
Fri, 23 November 2007 14:39  |
Eclipse User |
|
|
|
Originally posted by: raimund.berger.nowhere.com.org.dot.com.org
Yeah right, that's it. Wasn't sure whether this should be considered high
priority, but after reading through those comments plus the macro bug
report mentioned there it seems to me that constructs which potentially
change name bindings over translation units really aren't handled that
well. So this sure is a core issue.
Thanks for the pointer.
Greetings, Raimund.
|
|
|
Powered by
FUDForum. Page generated in 0.04460 seconds