forked from qt-creator/qt-creator
C++: base class and default argument for template class
Fix code completion in case:
struct Foo
{
int bar;
};
template <typename T1 = Foo>
struct Derived : T1 { };
int main()
{
Derived<> foo;
foo. // members from Foo are not proposed
return 0;
}
Task-number: QTCREATORBUG-12605
Change-Id: Ibe35c7b9a161e789057a4518c72390ac52489a3e
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
87dcde5564
commit
4aa4e64b77
@@ -1082,9 +1082,9 @@ ClassOrNamespace *ClassOrNamespace::nestedType(const Name *name, ClassOrNamespac
|
||||
const unsigned argumentCountOfSpecialization
|
||||
= templateSpecialization->templateParameterCount();
|
||||
|
||||
Subst subst(_control.data());
|
||||
if (_factory->expandTemplates()) {
|
||||
Clone cloner(_control.data());
|
||||
Subst subst(_control.data());
|
||||
for (unsigned i = 0; i < argumentCountOfSpecialization; ++i) {
|
||||
const TypenameArgument *tParam
|
||||
= templateSpecialization->templateParameterAt(i)->asTypenameArgument();
|
||||
@@ -1149,6 +1149,13 @@ ClassOrNamespace *ClassOrNamespace::nestedType(const Name *name, ClassOrNamespac
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!baseBinding && subst.contains(baseName)) {
|
||||
const FullySpecifiedType &fullType = subst[baseName];
|
||||
if (fullType.isValid()) {
|
||||
if (NamedType *namedType = fullType.type()->asNamedType())
|
||||
baseBinding = lookupType(namedType->name());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
SubstitutionMap map;
|
||||
for (unsigned i = 0;
|
||||
|
||||
Reference in New Issue
Block a user