Review Request: specializeFrom for functions and template identifier free specializations
Milian Wolff
mail at milianw.de
Wed Jul 13 17:42:41 UTC 2011
> On June 26, 2011, 11:29 a.m., David Nolden wrote:
> > languages/cpp/cppduchain/declarationbuilder.cpp, line 548
> > <http://git.reviewboard.kde.org/r/101690/diff/2/?file=24870#file24870line548>
> >
> > I think every member of a template-class is itself based on TemplateDeclaration too, so this TODO is obsolete.
>
> Olivier Jean de Gaalon wrote:
> Yep, that's true.
> -----------------
> But before I can push this, I must ask for some assistance.
> It seems that when you setSpecializedFrom on a function (or at least a non-template function of a template class), the duchain is unable to properly instantiate it, giving a borked context.
> Its imported class context doesn't have any declarations, and it somehow ends up importing itself as a parent context (since it's instantiated this doesn't happen via addImportedParent context, which would catch it).
> It will eventually end up in infinite recursion in cppduchain.cpp:getTemplateContext() and crash.
>
> Is there any chance you could take a look at that? I'm not sure at all what is the normal behavior of instantiation so it's hard for me to tell where it goes wrong.
>
> Reproduction:
> -----------------
>
> template<class Type>
> struct ConstantUnaryExpressionEvaluator {
>
> void evaluateSpecialTokens( int tokenKind, ConstantIntegralType* left ) {}
>
> };
>
> template<>
> void ConstantUnaryExpressionEvaluator<double>::evaluateSpecialTokens( int tokenKind, ConstantIntegralType* left ) {
> }
>
> template<>
> void ConstantUnaryExpressionEvaluator<float>::evaluateSpecialTokens( int tokenKind, ConstantIntegralType* left ) {
> }
> ------------------
>
> If you hit the reparse button once or twice it'll give you the infinite recursion death.
>
> David Nolden wrote:
> I will try to check that.
david, any update?
- Milian
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/101690/#review4166
-----------------------------------------------------------
On June 22, 2011, 5:49 a.m., Olivier Jean de Gaalon wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/101690/
> -----------------------------------------------------------
>
> (Updated June 22, 2011, 5:49 a.m.)
>
>
> Review request for KDevelop and David Nolden.
>
>
> Summary
> -------
>
> Set specializedFrom for TemplateDeclarations in more cases then before.
> Make expressionvisitor check specializedFrom to find type of "this".
>
> Also adds a test that should work (works in normal usage), but in the test environment for some reason the template declarations never have a templateContext().
>
>
> This addresses bug 183614.
> http://bugs.kde.org/show_bug.cgi?id=183614
>
>
> Diffs
> -----
>
> languages/cpp/cppduchain/declarationbuilder.h 2242da2
> languages/cpp/cppduchain/declarationbuilder.cpp 0423842
> languages/cpp/cppduchain/expressionvisitor.cpp eef33e3
> languages/cpp/cppduchain/tests/test_expressionparser.h 385568f
> languages/cpp/cppduchain/tests/test_expressionparser.cpp 22e123a
>
> Diff: http://git.reviewboard.kde.org/r/101690/diff
>
>
> Testing
> -------
>
>
> Thanks,
>
> Olivier Jean de
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20110713/087c45e6/attachment.html>
More information about the KDevelop-devel
mailing list