C++: Support default template argument lookup for specialization

This fixes std::vector, although it doesn't really resolve numeric
template arguments. It just picks the first specialization.

Use-case:
class Foo {};
template<class T1 = Foo> class Temp;
template<> class Temp<Foo> { int var; };
void func()
{
    Temp<> t;
    t.var; // var not highlighted
}

Task-number: QTCREATORBUG-8922
Change-Id: I593515beb3a6d901b6088db8bc1b8e16c39083d3
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
Orgad Shaneh
2015-06-07 11:47:50 +03:00
committed by Orgad Shaneh
parent 1c7e465c30
commit 97d3d9ac09
3 changed files with 74 additions and 40 deletions

View File

@@ -150,8 +150,13 @@ public:
/// \internal
LookupScope *allocLookupScope(LookupScope *parent, const Name *name);
FullySpecifiedType resolveTemplateArgument(Clone &cloner, Subst &subst,
LookupScope *origin,
const Template *specialization,
const TemplateNameId *instantiation,
unsigned index);
void initializeSubst(Clone &cloner, Subst &subst, LookupScope *origin,
Template *specialization, const TemplateNameId *instantiation);
const Template *specialization, const TemplateNameId *instantiation);
protected:
using SymbolVisitor::visit;