mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +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;
|
||||
// func(a, b);
|
||||
// }
|
||||
public void _testFunctionTemplate_319498() throws Exception {
|
||||
public void testFunctionTemplate_319498() throws Exception {
|
||||
ICPPFunction f= getBindingFromASTName("func(a, b)", 4, ICPPFunction.class);
|
||||
assertInstance(f, ICPPTemplateInstance.class);
|
||||
}
|
||||
|
|
|
@ -1052,7 +1052,9 @@ public class CPPVisitor extends ASTQueries {
|
|||
if (data != null) {
|
||||
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) {
|
||||
IType t = ((ITypedef) binding).getType();
|
||||
if (t instanceof IBinding)
|
||||
|
|
|
@ -80,8 +80,10 @@ class PDOMCPPUnknownClassInstance extends PDOMCPPUnknownClassType implements ICP
|
|||
|
||||
if (type instanceof PDOMNode) {
|
||||
PDOMNode node= (PDOMNode) type;
|
||||
if (node.getPDOM() == getPDOM()) {
|
||||
return node.getRecord() == getRecord();
|
||||
// Different PDOM bindings may result in equal types if a parent
|
||||
// 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) {
|
||||
PDOMNode node= (PDOMNode) type;
|
||||
if (node.getPDOM() == getPDOM()) {
|
||||
return node.getRecord() == getRecord();
|
||||
// Different PDOM bindings may result in equal types if a parent
|
||||
// turns out to be a template parameter.
|
||||
if (node.getPDOM() == getPDOM() && node.getRecord() == getRecord()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue