mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-21 21:52:10 +02:00
Bug 560173 - Fix destructor lookup in case of typedef
Added field isDestructor to LookupData class Change-Id: If2707c96eeb54dfc938dfc5caf69f0bbf71589ef
This commit is contained in:
parent
8bfc0447c9
commit
c68fa24969
3 changed files with 6 additions and 4 deletions
|
@ -3669,7 +3669,7 @@ public class AST2CPPSpecTest extends AST2SpecTestBase {
|
|||
// B_ptr->~B(); //2 // calls D's destructor
|
||||
// B_ptr->~B_alias(); //3 // calls D's destructor
|
||||
// B_ptr->B_alias::~B(); //4 // calls B's destructor
|
||||
// B_ptr->B_alias::~B_alias(); //5 // error, no B_alias in class B
|
||||
// B_ptr->B_alias::~B_alias(); //5 // calls B's destructor
|
||||
// }
|
||||
public void test12_4s12() throws Exception {
|
||||
final String code = getAboveComment();
|
||||
|
@ -3685,8 +3685,8 @@ public class AST2CPPSpecTest extends AST2SpecTestBase {
|
|||
assertSame(dtor, d);
|
||||
d = bh.assertNonProblem("~B(); //4", 2);
|
||||
assertSame(dtor, d);
|
||||
|
||||
bh.assertProblem("~B_alias(); //5", 8);
|
||||
d = bh.assertNonProblem("~B_alias(); //5", 8);
|
||||
assertSame(dtor, d);
|
||||
}
|
||||
|
||||
// void* operator new(size_t, void* p) { return p; }
|
||||
|
|
|
@ -1143,7 +1143,7 @@ public class CPPSemantics {
|
|||
return;
|
||||
}
|
||||
|
||||
if (data.qualified && !(scope instanceof ICPPTemplateScope)) {
|
||||
if (!data.isDestructor && data.qualified && !(scope instanceof ICPPTemplateScope)) {
|
||||
if (data.ignoreUsingDirectives || data.usingDirectives.isEmpty())
|
||||
return;
|
||||
data.usingDirectivesOnly = true;
|
||||
|
@ -1250,6 +1250,7 @@ public class CPPSemantics {
|
|||
ld2.fHeuristicBaseLookup = data.fHeuristicBaseLookup;
|
||||
ld2.qualified = parent instanceof ICPPASTQualifiedName;
|
||||
ld2.typesOnly = true;
|
||||
ld2.isDestructor = true;
|
||||
lookup(ld2, getLookupScope(typeDtorName));
|
||||
IBinding[] typedefs = ld2.getFoundBindings();
|
||||
ITypedef typedef = null;
|
||||
|
|
|
@ -123,6 +123,7 @@ public class LookupData extends ScopeLookupData {
|
|||
public ICPPClassType skippedScope;
|
||||
public Object foundItems;
|
||||
public ProblemBinding problem;
|
||||
public boolean isDestructor;
|
||||
|
||||
public LookupData(IASTName name) {
|
||||
super(name, true, false);
|
||||
|
|
Loading…
Add table
Reference in a new issue