Hello David,

thanks for the explanations. I will try to find a package using a compiler-based approach to solve my C++ completion problems.

I will also look at next semantic releases to see the future enhancements on the subject.

Thanks again for your help,


On Sat, Aug 31, 2013 at 12:59 AM, David Engster <deng@randomsample.de> wrote:
francois barjon writes:
> thanks for your answer. I imagine that handling C++ template expansion must be
> a tricky stuff! I am interested if there are enhancements on the subject.
> I have continued my tests on semantic completion for smart pointers. The
> completion works with boost shared_ptr but not with STL shared_ptr. Here are
> two code samples explaining why completion does not work in STL case.

Semantic's template handling is pretty basic. It cannot deal with
template default arguments and template specializations, which is why
many things especially from the STL are not parsed correctly (most
prominently the vector class). Also, at least the GNU STL makes
extensive use of typedef trickeries, which currently confuses Semantic a

I did extend the C++ grammar and the template/typedef parsing code a few
years ago to correctly parse <vector> from the GNU STL, but I never came
to merge it, because the Emacs merge was more important at that time,
and also because I was simply fed up with that template stuff. After
weeks of fiddling, I came to the conclusion that we should try to
delegate this nasty C++ parsing business to compilers like clang or gcc,
but that hasn't happened; anything we do with clang cannot get merged to
Emacs, and gcc lacks tooling support in the first place.

Since I'm doing a lot of C++ coding again, there's a good chance I dig
out that branch, though I'm afraid it has bit-rotted quite a bit.