Re: Semantic Anomaly
Eric Ludlam <[email protected]> Mon, 26 Jan 2015 12:53:36 -0500
| Newsgroups | gmane.emacs.semantic |
|---|---|
| Message-ID | <[email protected]> |
On 01/05/2015 04:41 AM, RJD wrote:
> I cannot really post any code example because of Copyright but I have
> something like this:
>
> void someFunc ( SomeClass& refToSomeClass,
> const NS1::SomeOtherClass& refToSomeOtherClass )
> {
> refToSomeClass. // does not work
> refToSomeOtherClass. // does work
> }
>
> The odd thing is when you put the cursor over a type the minibuffer
> generally brings up:
>
> SomeOtherClass.h: class SomeOtherClass
>
> And, this is very much the case for SomeOtherClass, however, when I put the
> cursor over SomeClass I get:
>
> SomeClass.cpp: void ~SomeClass (void)
>
> So, in the example which does not work: SomeClass, semantic is bringing up
> the destructor and why I cannot figure out.
>
> I can offer a more comprehensive example but it will take me a while to
> emulate what is going on. I ask here because perhaps one of the developers
> have come across such an issue.
Sorry for taking so long to reply. My kids robot building team has
taken up all my free time.
In order for the tools to find "SomeClass", the symbol needs to be
findable in your code. There are a few ways to trick the parser into
missing your class, the easiest of which is to use C macros to create
your classes, or to hide your definitions in:
#ifdef SOMEVAR
class SomeClass ....
#endif
and not have the parsers macro table set up correctly. (See
semantic-lex-c-preprocessor-symbol-map or
semantic-lex-c-preprocessor-symbol-file, or preferably use EDE (the
project system) to restrict those variables to a specific directory only
using `ede-cpp-root', or `ede-enable-generic-projects' and then using
`customize-project'.
If SomeClass is in a namespace, and you have a using statement, try
moving the using statement into the same file as the code you are trying
to edit. I thought it worked from headers too, but maybe your headers
have some macro excitement around your using statement too.
I hope this helps.
Eric
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/