1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-09 09:15:38 +02:00

Bug 460341 - Nested Template Specialization not properly resolved

Change-Id: I10564878dc0daacad58d164941d73749bf77e787
Signed-off-by: Michi <woskimi@yahoo.de>
This commit is contained in:
Michi 2015-02-19 13:24:29 +01:00
parent 8968b8f2ca
commit 151a5d30c5
2 changed files with 23 additions and 0 deletions

View file

@ -713,6 +713,10 @@ public class CPPTemplates {
IASTName templateName = id.getTemplateName();
IBinding template = templateName.resolvePreBinding();
while (template instanceof CPPTypedefSpecialization) {
template = ((CPPTypedefSpecialization) template).getSpecializedBinding();
}
// Alias template.
if (template instanceof ICPPAliasTemplate) {
ICPPAliasTemplate aliasTemplate = (ICPPAliasTemplate) template;

View file

@ -1506,6 +1506,25 @@ public class CompletionTests extends AbstractContentAssistTest {
assertContentAssistResults(fCursorOffset, expected, true, ID);
}
// template <int T>
// struct A {
// template <int TT>
// struct AA {
// template <typename TTT>
// using Type = TTT;
// };
// };
//
// struct B{
// static int i;
// };
//
// A<0>::AA<0>::Type<B>::/*cursor*/
public void testNestedTemplateSpecialization_460341() throws Exception {
final String[] expected = { "i" };
assertContentAssistResults(fCursorOffset, expected, true, ID);
}
// void foo() { Specialization<int, /*cursor*/
public void testTemplateArgumentList() throws Exception {
setCommaAfterFunctionParameter(CCorePlugin.INSERT);