mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-11 10:15:39 +02:00
Bug 442742 - "Organize Includes" removes a header required for a
namespace alias
This commit is contained in:
parent
af51f687e2
commit
565aae76ba
2 changed files with 16 additions and 0 deletions
|
@ -348,6 +348,19 @@ public class BindingClassifierTest extends OneSourceMultipleHeadersTestCase {
|
||||||
assertDeclared();
|
assertDeclared();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// namespace ns1 {
|
||||||
|
// namespace ns2 {
|
||||||
|
// class A {};
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// namespace ns = ns1::ns2;
|
||||||
|
|
||||||
|
// ns::A a;
|
||||||
|
public void testNamespaceAlias() throws Exception {
|
||||||
|
assertDefined("A", "ns");
|
||||||
|
assertDeclared();
|
||||||
|
}
|
||||||
|
|
||||||
// struct A {
|
// struct A {
|
||||||
// A(const char* s);
|
// A(const char* s);
|
||||||
// };
|
// };
|
||||||
|
|
|
@ -103,6 +103,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMember;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMember;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespace;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespace;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespaceAlias;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPParameter;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPParameter;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPReferenceType;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPReferenceType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization;
|
||||||
|
@ -1020,6 +1021,8 @@ public class BindingClassifier {
|
||||||
* or an empty list if no such binding is available.
|
* or an empty list if no such binding is available.
|
||||||
*/
|
*/
|
||||||
private Set<IBinding> getRequiredBindings(IBinding binding) {
|
private Set<IBinding> getRequiredBindings(IBinding binding) {
|
||||||
|
if (binding instanceof ICPPNamespaceAlias)
|
||||||
|
return Collections.singleton(binding);
|
||||||
if (binding instanceof ICPPNamespace)
|
if (binding instanceof ICPPNamespace)
|
||||||
return Collections.emptySet();
|
return Collections.emptySet();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue