mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
NPE resolving template-id in using-decl, bug 251199.
This commit is contained in:
parent
f9a7cd90e1
commit
129297342f
2 changed files with 16 additions and 4 deletions
|
@ -6134,6 +6134,14 @@ public class AST2CPPTests extends AST2BaseTest {
|
|||
ba.assertProblem("a; // should not resolve", 1);
|
||||
}
|
||||
}
|
||||
|
||||
// namespace ns {
|
||||
// template<typename T> class CT {};
|
||||
// }
|
||||
// using ns::CT<int>;
|
||||
public void testTemplateIDInUsingDecl_251199() throws Exception {
|
||||
parseAndCheckBindings(getAboveComment(), ParserLanguage.CPP);
|
||||
}
|
||||
|
||||
// void f();
|
||||
//
|
||||
|
|
|
@ -470,10 +470,14 @@ public class CPPTemplates {
|
|||
parent = parent.getParent();
|
||||
}
|
||||
|
||||
IASTNode decl = parent.getParent();
|
||||
while (!(decl instanceof IASTDeclaration))
|
||||
decl = decl.getParent();
|
||||
decl = decl.getParent();
|
||||
IASTNode decl= parent;
|
||||
while (decl != null) {
|
||||
if (decl instanceof IASTDeclaration) {
|
||||
decl= decl.getParent();
|
||||
break;
|
||||
}
|
||||
decl= decl.getParent();
|
||||
}
|
||||
|
||||
try {
|
||||
if (decl instanceof ICPPASTExplicitTemplateInstantiation &&
|
||||
|
|
Loading…
Add table
Reference in a new issue