diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPBindingResolutionBugsTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPBindingResolutionBugsTest.java index 75c2e29af3c..41b09277131 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPBindingResolutionBugsTest.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPBindingResolutionBugsTest.java @@ -1397,4 +1397,21 @@ public abstract class IndexCPPBindingResolutionBugsTest extends IndexBindingReso ast = workingCopy.getAST(strategy.getIndex(), ITranslationUnit.AST_SKIP_INDEXED_HEADERS); checkBindings(ast); } + + // struct MyClass { + // MyClass(); + // struct MyInnerClass; + // }; + + // struct MyClass::MyInnerClass { + // MyInnerClass(bool a, bool b) { + // } + // }; + // + // MyClass::MyClass() { + // new MyInnerClass(true, true); + // } + public void testIssue_254() throws Exception { + checkBindings(); + } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java index 5d7c92b7cb5..fe32496e653 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java @@ -2125,7 +2125,14 @@ public class CPPSemantics { } IASTTranslationUnit tu = node.getTranslationUnit(); IIndexFileSet indexFileSet = tu.getIndexFileSet(); - return (indexFileSet != null && indexFileSet.containsDeclaration(indexBinding)); + if (indexFileSet != null && indexFileSet.containsDeclaration(indexBinding)) { + return true; + } else if (indexBinding instanceof ICPPConstructor) { + IIndexFileSet astFileSet = tu.getASTFileSet(); + return astFileSet != null && astFileSet.containsDeclaration(indexBinding); + } else { + return false; + } } } return pointOfDecl < pointOfRef;