From d045434e7c2fc1b83f68779ca79890f53bc2ab05 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Sat, 24 Mar 2007 03:50:31 +0000 Subject: [PATCH] Patch for Bryan - 177055 improving CPPClassSpecialization. --- .../parser/cpp/CPPClassSpecialization.java | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassSpecialization.java index 65b779b9918..dfff1da21b8 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassSpecialization.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassSpecialization.java @@ -23,7 +23,6 @@ import org.eclipse.cdt.core.dom.ast.IASTNode; import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration; import org.eclipse.cdt.core.dom.ast.IBinding; import org.eclipse.cdt.core.dom.ast.IField; -import org.eclipse.cdt.core.dom.ast.IProblemBinding; import org.eclipse.cdt.core.dom.ast.IScope; import org.eclipse.cdt.core.dom.ast.IType; import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier; @@ -76,8 +75,15 @@ public class CPPClassSpecialization extends CPPSpecialization implements */ public ICPPBase[] getBases() throws DOMException { if( getDefinition() == null ){ - IASTNode node = (getDeclarations() != null && getDeclarations().length > 0) ? getDeclarations()[0] : null; - return new ICPPBase [] { new CPPBaseClause.CPPBaseProblem( node, IProblemBinding.SEMANTIC_DEFINITION_NOT_FOUND, getNameCharArray() ) }; + ICPPBase[] bindings = ((ICPPClassType)getSpecializedBinding()).getBases(); + for (int i = 0; i < bindings.length; i++) { + IBinding base = bindings[i].getBaseClass(); + if (base instanceof IType) { + IType specBase = CPPTemplates.instantiateType((IType) base, argumentMap); + ((CPPBaseClause)bindings[i]).setBaseClass((ICPPClassType)specBase); + } + } + return bindings; } ICPPASTBaseSpecifier[] bases = getCompositeTypeSpecifier().getBaseSpecifiers(); @@ -151,11 +157,6 @@ public class CPPClassSpecialization extends CPPSpecialization implements * @see org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType#getConstructors() */ public ICPPConstructor[] getConstructors() throws DOMException { - if( getDefinition() == null ){ - IASTNode node = (getDeclarations() != null && getDeclarations().length > 0) ? getDeclarations()[0] : null; - return new ICPPConstructor [] { new CPPConstructor.CPPConstructorProblem( node, IProblemBinding.SEMANTIC_DEFINITION_NOT_FOUND, getNameCharArray() ) }; - } - IScope scope = getCompositeScope(); if (scope instanceof CPPClassSpecializationScope) { if (ASTInternal.isFullyCached(scope)) @@ -244,10 +245,6 @@ public class CPPClassSpecialization extends CPPSpecialization implements } public ICPPMethod[] getConversionOperators() { - if( getDefinition() == null ){ - IASTNode node = (getDeclarations() != null && getDeclarations().length > 0) ? getDeclarations()[0] : null; - return new ICPPMethod[] { new CPPMethod.CPPMethodProblem( node, IProblemBinding.SEMANTIC_DEFINITION_NOT_FOUND, getNameCharArray() ) }; - } try { ICPPMethod [] result = null;