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
|
@ -6135,6 +6135,14 @@ public class AST2CPPTests extends AST2BaseTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// namespace ns {
|
||||||
|
// template<typename T> class CT {};
|
||||||
|
// }
|
||||||
|
// using ns::CT<int>;
|
||||||
|
public void testTemplateIDInUsingDecl_251199() throws Exception {
|
||||||
|
parseAndCheckBindings(getAboveComment(), ParserLanguage.CPP);
|
||||||
|
}
|
||||||
|
|
||||||
// void f();
|
// void f();
|
||||||
//
|
//
|
||||||
// void test(int p) {
|
// void test(int p) {
|
||||||
|
|
|
@ -470,10 +470,14 @@ public class CPPTemplates {
|
||||||
parent = parent.getParent();
|
parent = parent.getParent();
|
||||||
}
|
}
|
||||||
|
|
||||||
IASTNode decl = parent.getParent();
|
IASTNode decl= parent;
|
||||||
while (!(decl instanceof IASTDeclaration))
|
while (decl != null) {
|
||||||
decl = decl.getParent();
|
if (decl instanceof IASTDeclaration) {
|
||||||
decl = decl.getParent();
|
decl= decl.getParent();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
decl= decl.getParent();
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (decl instanceof ICPPASTExplicitTemplateInstantiation &&
|
if (decl instanceof ICPPASTExplicitTemplateInstantiation &&
|
||||||
|
|
Loading…
Add table
Reference in a new issue