mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-09-10 03:53:21 +02:00
Bug 520999 - Map PDOM class types to AST before looking up constructors
Change-Id: Iac865cbde8ed4ba2b002eea0da7d943598d33bc1
This commit is contained in:
parent
30c0a1da7c
commit
33a7f1e533
2 changed files with 21 additions and 0 deletions
|
@ -2480,4 +2480,19 @@ public class IndexCPPBindingResolutionTest extends IndexBindingResolutionTestBas
|
||||||
public void testSelfReferencingVariable_510484() throws Exception {
|
public void testSelfReferencingVariable_510484() throws Exception {
|
||||||
checkBindings();
|
checkBindings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// class Foo {
|
||||||
|
// struct Bar;
|
||||||
|
// void func();
|
||||||
|
// };
|
||||||
|
|
||||||
|
// struct Foo::Bar {
|
||||||
|
// Bar(int, int);
|
||||||
|
// };
|
||||||
|
// void Foo::func() {
|
||||||
|
// Bar waldo(0, 0);
|
||||||
|
// }
|
||||||
|
public void testNestedClassDefinedOutOfLine_502999() throws Exception {
|
||||||
|
checkBindings();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3593,6 +3593,12 @@ public class CPPSemantics {
|
||||||
return null;
|
return null;
|
||||||
if (type instanceof ICPPClassTemplate || type instanceof ICPPUnknownType || type instanceof ISemanticProblem)
|
if (type instanceof ICPPClassTemplate || type instanceof ICPPUnknownType || type instanceof ISemanticProblem)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
// The class type may be declared in a header but defined in the AST.
|
||||||
|
// In such a case, we want the constructors as AST bindings (since as
|
||||||
|
// index bindings they would fail declaredBefore() filtering), so map
|
||||||
|
// the class type to its AST representation.
|
||||||
|
type = SemanticUtil.mapToAST(type, name);
|
||||||
|
|
||||||
return findImplicitlyCalledConstructor((ICPPClassType) type, initializer, name);
|
return findImplicitlyCalledConstructor((ICPPClassType) type, initializer, name);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue