forked from qt-creator/qt-creator
C++: Fix crash on static template instantiation
template<typename T>
struct QList
{
struct iterator
{
T *operator->() { return &t; }
T t;
};
static iterator begin() { return iterator(); }
};
struct Foo { int bar; };
void fun() {
auto a = QList<Foo>::begin();
a. // crash
}
Change-Id: I373c493b2eefc9566ec13165285c33d474a3b440
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
8c11485edb
commit
b30e807fac
2
src/libs/3rdparty/cplusplus/Templates.cpp
vendored
2
src/libs/3rdparty/cplusplus/Templates.cpp
vendored
@@ -100,7 +100,7 @@ void CloneType::visit(NamedType *type)
|
||||
const Name *name = _clone->name(type->name(), _subst);
|
||||
FullySpecifiedType ty;
|
||||
if (_subst)
|
||||
ty = _subst->apply(name);
|
||||
ty = _clone->type(_subst->apply(name), 0);
|
||||
if (! ty.isValid())
|
||||
ty = _control->namedType(name);
|
||||
_type.setType(ty.type());
|
||||
|
||||
Reference in New Issue
Block a user