mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-01 21:35:40 +02:00
Bug 433556 - Unqualified name of the containing template is not resolved
This commit is contained in:
parent
9ea599ef7b
commit
8e871b492f
2 changed files with 11 additions and 5 deletions
|
@ -432,7 +432,7 @@ public class AST2CPPTests extends AST2TestBase {
|
||||||
// struct A<T>::B {
|
// struct A<T>::B {
|
||||||
// typedef typename A::type type;
|
// typedef typename A::type type;
|
||||||
// };
|
// };
|
||||||
public void _testBug433556() throws Exception {
|
public void testBug433556() throws Exception {
|
||||||
parseAndCheckBindings();
|
parseAndCheckBindings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -300,7 +300,7 @@ public class CPPTemplates {
|
||||||
// definition cannot be inside a template scope, we can accurately return null
|
// definition cannot be inside a template scope, we can accurately return null
|
||||||
// in this case.
|
// in this case.
|
||||||
if (functionName.getParent() instanceof ICPPASTQualifiedName
|
if (functionName.getParent() instanceof ICPPASTQualifiedName
|
||||||
&& ASTQueries.isAncestorOf(functionName.getParent(), name)) {
|
&& ASTQueries.isAncestorOf(functionName.getParent(), name)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
scope= CPPVisitor.getContainingScope(functionName);
|
scope= CPPVisitor.getContainingScope(functionName);
|
||||||
|
@ -334,9 +334,15 @@ public class CPPTemplates {
|
||||||
}
|
}
|
||||||
if (scope instanceof IASTInternalScope) {
|
if (scope instanceof IASTInternalScope) {
|
||||||
IASTInternalScope internalScope= (IASTInternalScope) scope;
|
IASTInternalScope internalScope= (IASTInternalScope) scope;
|
||||||
scope= CPPVisitor.getContainingScope(internalScope.getPhysicalNode());
|
IASTNode physicalNode = internalScope.getPhysicalNode();
|
||||||
if (scope == internalScope)
|
if (physicalNode instanceof ICPPASTCompositeTypeSpecifier &&
|
||||||
return null;
|
((ICPPASTCompositeTypeSpecifier) physicalNode).getName() instanceof ICPPASTQualifiedName) {
|
||||||
|
scope= scope.getParent();
|
||||||
|
} else {
|
||||||
|
scope= CPPVisitor.getContainingScope(physicalNode);
|
||||||
|
if (scope == internalScope)
|
||||||
|
return null;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
scope= scope.getParent();
|
scope= scope.getParent();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue