mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 09:46:02 +02:00
Bug 319498: Comparison of unknown bindings.
This commit is contained in:
parent
cbab1664c5
commit
ca93e4ae7e
4 changed files with 12 additions and 6 deletions
|
@ -975,7 +975,7 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa
|
||||||
// int b;
|
// int b;
|
||||||
// func(a, b);
|
// func(a, b);
|
||||||
// }
|
// }
|
||||||
public void _testFunctionTemplate_319498() throws Exception {
|
public void testFunctionTemplate_319498() throws Exception {
|
||||||
ICPPFunction f= getBindingFromASTName("func(a, b)", 4, ICPPFunction.class);
|
ICPPFunction f= getBindingFromASTName("func(a, b)", 4, ICPPFunction.class);
|
||||||
assertInstance(f, ICPPTemplateInstance.class);
|
assertInstance(f, ICPPTemplateInstance.class);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1052,7 +1052,9 @@ public class CPPVisitor extends ASTQueries {
|
||||||
if (data != null) {
|
if (data != null) {
|
||||||
data.usesEnclosingScope= false;
|
data.usesEnclosingScope= false;
|
||||||
}
|
}
|
||||||
IBinding binding = names[i - 1].resolveBinding();
|
// For template functions we may need to resolve a template parameter
|
||||||
|
// as a parent of an unknown type used as parameter type.
|
||||||
|
IBinding binding = names[i - 1].resolvePreBinding();
|
||||||
while (binding instanceof ITypedef) {
|
while (binding instanceof ITypedef) {
|
||||||
IType t = ((ITypedef) binding).getType();
|
IType t = ((ITypedef) binding).getType();
|
||||||
if (t instanceof IBinding)
|
if (t instanceof IBinding)
|
||||||
|
|
|
@ -80,8 +80,10 @@ class PDOMCPPUnknownClassInstance extends PDOMCPPUnknownClassType implements ICP
|
||||||
|
|
||||||
if (type instanceof PDOMNode) {
|
if (type instanceof PDOMNode) {
|
||||||
PDOMNode node= (PDOMNode) type;
|
PDOMNode node= (PDOMNode) type;
|
||||||
if (node.getPDOM() == getPDOM()) {
|
// Different PDOM bindings may result in equal types if a parent
|
||||||
return node.getRecord() == getRecord();
|
// turns out to be a template parameter.
|
||||||
|
if (node.getPDOM() == getPDOM() && node.getRecord() == getRecord()) {
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -235,8 +235,10 @@ class PDOMCPPUnknownClassType extends PDOMCPPUnknownBinding implements ICPPClass
|
||||||
|
|
||||||
if (type instanceof PDOMNode) {
|
if (type instanceof PDOMNode) {
|
||||||
PDOMNode node= (PDOMNode) type;
|
PDOMNode node= (PDOMNode) type;
|
||||||
if (node.getPDOM() == getPDOM()) {
|
// Different PDOM bindings may result in equal types if a parent
|
||||||
return node.getRecord() == getRecord();
|
// turns out to be a template parameter.
|
||||||
|
if (node.getPDOM() == getPDOM() && node.getRecord() == getRecord()) {
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue