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 41b09277131..7007d2d2c64 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2015 Wind River Systems, Inc. and others. + * Copyright (c) 2006, 2023 Wind River Systems, Inc. and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -1414,4 +1414,37 @@ public abstract class IndexCPPBindingResolutionBugsTest extends IndexBindingReso public void testIssue_254() throws Exception { checkBindings(); } + + // // no header needed + + // void introducing_in_global_ns(struct struct_in_global_ns *arg) {} + // + // class UsingStructFromGlobalNamespace { + // struct_in_global_ns *p; + // }; + // + // UsingStructFromGlobalNamespace usingStructFromGlobalNs; + // + // namespace named { + // void introducing_in_named_ns(struct struct_in_named_ns *arg) {} + // } + // + // class UsingStructFromNamespaceNs { + // named::struct_in_named_ns *p; + // }; + // + // UsingStructFromNamespaceNs usingStructFromNamespaceNs; + // + // namespace { + // void introducing_in_anonymous_ns(struct struct_in_anonymous_ns *arg) {} + // } + // + // class UsingStructFromAnonymousNs { + // struct_in_anonymous_ns *p; + // }; + // + // UsingStructFromAnonymousNs usingStructFromAnonymousNs; + public void testStructNameIntroducedInNamespace() 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 69a3591d454..e767efafa01 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2016 IBM Corporation and others. + * Copyright (c) 2004, 2023 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -2513,7 +2513,7 @@ public class CPPSemantics { IIndexFileSet indexFileSet = tu.getIndexFileSet(); if (indexFileSet != null && indexFileSet.containsDeclaration(indexBinding)) { return true; - } else if (indexBinding instanceof ICPPConstructor) { + } else if (indexBinding instanceof ICPPConstructor || indexBinding instanceof ICPPClassType) { IIndexFileSet astFileSet = tu.getASTFileSet(); return astFileSet != null && astFileSet.containsDeclaration(indexBinding); } else {