From 3f989cc33f9d1782059066d789bf67956076b71e Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Wed, 3 May 2006 18:10:40 +0000 Subject: [PATCH] Fixed a couple of exceptions when fast indexing ACE&TAO. --- .../internal/core/dom/parser/cpp/CPPClassScope.java | 4 +++- .../internal/core/dom/parser/cpp/CPPSemantics.java | 11 ++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassScope.java index 9d877a71c68..54eddf1aa53 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassScope.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassScope.java @@ -82,7 +82,9 @@ public class CPPClassScope extends CPPScope implements ICPPClassScope { ICPPClassType clsType = (ICPPClassType) binding; if( clsType instanceof ICPPClassTemplate ){ try { - clsType = (ICPPClassType) CPPTemplates.instantiateWithinClassTemplate( (ICPPClassTemplate) clsType ); + IBinding within = CPPTemplates.instantiateWithinClassTemplate( (ICPPClassTemplate) clsType ); + if (within instanceof ICPPClassType) + clsType = (ICPPClassType)within; } catch ( DOMException e ) { } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPSemantics.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPSemantics.java index 7582551ab24..8e125b76189 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPSemantics.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPSemantics.java @@ -1228,8 +1228,11 @@ public class CPPSemantics { if( data.visited == ObjectSet.EMPTY_SET ) data.visited = new ObjectSet(2); IBinding b = bases[i].getBaseClass(); - if( b instanceof ICPPClassType ) - data.visited.put( ((ICPPClassType)b).getCompositeScope() ); + if( b instanceof ICPPClassType ) { + IScope bScope = ((ICPPClassType)b).getCompositeScope(); + if (bScope != null) + data.visited.put(bScope); + } } else { IBinding b = bases[i].getBaseClass(); if( b instanceof ICPPClassType ) @@ -2150,7 +2153,9 @@ public class CPPSemantics { cls = new CPPClassType.CPPClassTypeProblem( scope.getPhysicalNode(), IProblemBinding.SEMANTIC_BAD_SCOPE, fn.getNameCharArray() ); } if( cls instanceof ICPPClassTemplate ){ - cls = (ICPPClassType) CPPTemplates.instantiateWithinClassTemplate( (ICPPClassTemplate) cls ); + IBinding within = CPPTemplates.instantiateWithinClassTemplate( (ICPPClassTemplate) cls ); + if (within instanceof ICPPClassType) + cls = (ICPPClassType)within; } IType implicitType = cls; if( ftype.isConst() || ftype.isVolatile() ){