1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 17:05:26 +02:00

Bug 433556 - Unqualified name of the containing template is not resolved

This commit is contained in:
Sergey Prigogin 2014-04-25 22:22:05 -07:00
parent 9ea599ef7b
commit 8e871b492f
2 changed files with 11 additions and 5 deletions

View file

@ -432,7 +432,7 @@ public class AST2CPPTests extends AST2TestBase {
// struct A<T>::B {
// typedef typename A::type type;
// };
public void _testBug433556() throws Exception {
public void testBug433556() throws Exception {
parseAndCheckBindings();
}

View file

@ -300,7 +300,7 @@ public class CPPTemplates {
// definition cannot be inside a template scope, we can accurately return null
// in this case.
if (functionName.getParent() instanceof ICPPASTQualifiedName
&& ASTQueries.isAncestorOf(functionName.getParent(), name)) {
&& ASTQueries.isAncestorOf(functionName.getParent(), name)) {
return null;
}
scope= CPPVisitor.getContainingScope(functionName);
@ -334,9 +334,15 @@ public class CPPTemplates {
}
if (scope instanceof IASTInternalScope) {
IASTInternalScope internalScope= (IASTInternalScope) scope;
scope= CPPVisitor.getContainingScope(internalScope.getPhysicalNode());
if (scope == internalScope)
return null;
IASTNode physicalNode = internalScope.getPhysicalNode();
if (physicalNode instanceof ICPPASTCompositeTypeSpecifier &&
((ICPPASTCompositeTypeSpecifier) physicalNode).getName() instanceof ICPPASTQualifiedName) {
scope= scope.getParent();
} else {
scope= CPPVisitor.getContainingScope(physicalNode);
if (scope == internalScope)
return null;
}
} else {
scope= scope.getParent();
}