diff options
Diffstat (limited to 'src/libs/3rdparty/cplusplus/Templates.cpp')
-rw-r--r-- | src/libs/3rdparty/cplusplus/Templates.cpp | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/src/libs/3rdparty/cplusplus/Templates.cpp b/src/libs/3rdparty/cplusplus/Templates.cpp index 41e462a3b8..3b8ae9a23f 100644 --- a/src/libs/3rdparty/cplusplus/Templates.cpp +++ b/src/libs/3rdparty/cplusplus/Templates.cpp @@ -125,12 +125,6 @@ void CloneType::visit(Template *type) _type = templ; } -void CloneType::visit(ExplicitInstantiation *type) -{ - ExplicitInstantiation *inst = _clone->symbol(type, _subst)->asExplicitInstantiation(); - _type = inst; -} - void CloneType::visit(Class *type) { Class *klass = _clone->symbol(type, _subst)->asClass(); @@ -194,8 +188,10 @@ Symbol *CloneSymbol::cloneSymbol(Symbol *symbol, Subst *subst) SymbolSubstPair symbolSubstPair = std::make_pair(symbol, subst); auto it = _cache.find(symbolSubstPair); - if (it != _cache.end()) - return it->second; + if (it != _cache.end()) { + if (it->second->enclosingScope() == symbol->enclosingScope()) + return it->second; + } Symbol *r = 0; std::swap(_subst, subst); @@ -297,14 +293,6 @@ bool CloneSymbol::visit(Template *symbol) return false; } -bool CloneSymbol::visit(ExplicitInstantiation *symbol) -{ - ExplicitInstantiation *inst = new ExplicitInstantiation(_clone, _subst, symbol); - _symbol = inst; - _control->addSymbol(inst); - return false; -} - bool CloneSymbol::visit(Class *symbol) { Class *klass = new Class(_clone, _subst, symbol); |