From bd4656755c534405ddb9820ed7b707478581e89b Mon Sep 17 00:00:00 2001 From: Nathan Ridge Date: Mon, 29 May 2017 01:39:56 -0400 Subject: [PATCH] Bug 516338 - Avoid calling instantiateType() on arguments of non-dependent template instances Change-Id: I51628e9b6ca569943879f48d4c0d0b740bdc23b8 --- .../dom/parser/cpp/semantics/CPPTemplates.java | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPTemplates.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPTemplates.java index ee3cce19e77..8d2f4e0d638 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPTemplates.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPTemplates.java @@ -1484,7 +1484,7 @@ public class CPPTemplates { public static IType instantiateType(final IType type, InstantiationContext context) { if (context.getParameterMap() == null) return type; - + TypeInstantiationRequest instantiationRequest = new TypeInstantiationRequest(type, context); if (!instantiationsInProgress.get().add(instantiationRequest)) { return type instanceof ICPPFunctionType ? @@ -1575,21 +1575,6 @@ public class CPPTemplates { return (IType) ((ICPPClassSpecialization) newOwner).specializeMember(typeAsBinding, context.getPoint()); } } - - if (unwound instanceof ICPPTemplateInstance && !(unwound instanceof ICPPDeferredClassInstance)) { - // Argument of a class specialization can be a nested class subject to specialization. - final ICPPTemplateInstance classInstance = (ICPPTemplateInstance) unwound; - final IBinding origClass = classInstance.getSpecializedBinding(); - if (origClass instanceof ICPPClassType) { - ICPPTemplateArgument[] args = classInstance.getTemplateArguments(); - ICPPTemplateArgument[] newArgs = instantiateArguments(args, context, false); - if (newArgs != args) { - CPPTemplateParameterMap tparMap = - instantiateArgumentMap(classInstance.getTemplateParameterMap(), context); - return new CPPClassInstance((ICPPClassType) origClass, classInstance.getOwner(), tparMap, args); - } - } - } } // An alias template instance may have dependent arguments that don't contribute