diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTTranslationUnit.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTTranslationUnit.java index fcebcabf0e1..3d0f0d656af 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTTranslationUnit.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTTranslationUnit.java @@ -50,7 +50,6 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCatchHandler; import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTConstructorChainInitializer; import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionDeclarator; import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionTryBlockDeclarator; -import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTLinkageSpecification; import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTOperatorName; import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTranslationUnit; import org.eclipse.cdt.core.dom.ast.cpp.ICPPBasicType; @@ -288,8 +287,7 @@ public class CPPASTTranslationUnit extends CPPASTNode implements } // skip the rest of this node if the selection is outside of its bounds - // TODO take out fix below for bug 86993 check for: !(node instanceof ICPPASTLinkageSpecification) - if (node instanceof ASTNode && !(node instanceof ICPPASTLinkageSpecification) && + if (node instanceof ASTNode && offset > ((ASTNode)node).getOffset() + ((ASTNode)node).getLength()) return PROCESS_SKIP; @@ -299,8 +297,7 @@ public class CPPASTTranslationUnit extends CPPASTNode implements public int visit(IASTDeclaration declaration) { // use declarations to determine if the search has gone past the offset (i.e. don't know the order the visitor visits the nodes) - // TODO take out fix below for bug 86993 check for: !(declaration instanceof ICPPASTLinkageSpecification) - if (declaration instanceof ASTNode && !(declaration instanceof ICPPASTLinkageSpecification) && ((ASTNode)declaration).getOffset() > offset) + if (declaration instanceof ASTNode && ((ASTNode)declaration).getOffset() > offset) return PROCESS_ABORT; return processNode(declaration); diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/CPPPopulateASTViewAction.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/CPPPopulateASTViewAction.java index f2e68fbd3ea..f68af616a00 100644 --- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/CPPPopulateASTViewAction.java +++ b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/CPPPopulateASTViewAction.java @@ -1,15 +1,17 @@ /******************************************************************************* - * Copyright (c) 2005, 2006 IBM Corporation and others. + * Copyright (c) 2005, 2007 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * IBM Rational Software - Initial API and implementation + * IBM Rational Software - Initial API and implementation *******************************************************************************/ package org.eclipse.cdt.ui.tests.DOMAST; +import org.eclipse.core.runtime.IProgressMonitor; + import org.eclipse.cdt.core.dom.ast.IASTArrayDeclarator; import org.eclipse.cdt.core.dom.ast.IASTArrayModifier; import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier; @@ -35,13 +37,12 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCatchHandler; import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTConstructorChainInitializer; import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionDeclarator; import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionTryBlockDeclarator; -import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTLinkageSpecification; import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNamespaceDefinition; import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier.ICPPASTBaseSpecifier; import org.eclipse.cdt.core.parser.util.ArrayUtil; + import org.eclipse.cdt.internal.core.dom.parser.ASTNode; import org.eclipse.cdt.internal.core.parser.scanner2.LocationMap.ASTInclusionStatement; -import org.eclipse.core.runtime.IProgressMonitor; /** * @author dsteffle @@ -91,8 +92,7 @@ public class CPPPopulateASTViewAction extends CPPASTVisitor implements IPopulate if (node == null) return new DOMASTNodeLeafContinue(null); // only do length check for ASTNode (getNodeLocations on PreprocessorStatements is very expensive) - if (!(node instanceof ICPPASTLinkageSpecification) && - node instanceof ASTNode && ((ASTNode)node).getLength() <= 0) + if (node instanceof ASTNode && ((ASTNode)node).getLength() <= 0) return new DOMASTNodeLeafContinue(null); DOMASTNodeParent parent = null;