I wondered why I always got the error message "Could not find suitable
implementation." when invoking semantic-analyze-proto-impl-toggle on a
C++ method declaration.
After searching around for a while I observered that Semantic seems not
be able to apply a 'using namespace' declaration correctly on method
Instead of putting them into the namespace defined by a preceding using
declaration, Semantic stores these at global scope, causing
semantic-analyze-proto-impl-toggle to be unable to find the
implementation for a method declaration.
The problem vanishes only if the method implementations are put
explicitly into the right namespace hierarchy.
using namespace A::B;
/* -- with these comments Semantic is not able to find the
implementation for Test::bla when invoking
semantic-analyze-proto-impl-toggle on its declaration,
* without the comments it does
; Object AnalyzerTest
;; EDE Project Files are auto generated: Do Not Edit
I'm using Emacs GNU Emacs 23.3.1 (x86_64-pc-linux-gnu, GTK+ Version
2.24.8) with CEDET from bazaar (Revision 8225).
From: David Engster <deng@ra...> - 2012-03-29 18:39:49
Hendrik Kühne writes:
> After searching around for a while I observered that Semantic seems
> not be able to apply a 'using namespace' declaration correctly on
> method implementations.
Well, sort of. It does look at using statements when calculating scope,
but it does so on the fly when you look up types. However, in this case,
this is not enough...
> Instead of putting them into the namespace defined by a preceding
> using declaration, Semantic stores these at global scope, causing
> semantic-analyze-proto-impl-toggle to be unable to find the
> implementation for a method declaration.
Yep. On a general note, it's really hard to deal with the using
directive since it can be placed practically anywhere and will change
name lookup from there on; Semantic actually doesn't care for that - it
always implicitly assumes that the using directive applies to the whole
scope, which is incorrect, but we're in good(?) company there.
Your problem is even harder, and I'd be very surprised if there's an
easy fix. I currently wouldn't even know where to start. I think we have
to somehow interpret the using directive as a namespace declaration, but
carefully avoiding all the pitfalls since they are of course not the
I guess we could also hack around the problem, by searching for all
Test::bla types and checking if there's a using statement in their
 See the note at