mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-10 17:55:39 +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:
parent
8968b8f2ca
commit
151a5d30c5
2 changed files with 23 additions and 0 deletions
|
@ -713,6 +713,10 @@ public class CPPTemplates {
|
||||||
IASTName templateName = id.getTemplateName();
|
IASTName templateName = id.getTemplateName();
|
||||||
IBinding template = templateName.resolvePreBinding();
|
IBinding template = templateName.resolvePreBinding();
|
||||||
|
|
||||||
|
while (template instanceof CPPTypedefSpecialization) {
|
||||||
|
template = ((CPPTypedefSpecialization) template).getSpecializedBinding();
|
||||||
|
}
|
||||||
|
|
||||||
// Alias template.
|
// Alias template.
|
||||||
if (template instanceof ICPPAliasTemplate) {
|
if (template instanceof ICPPAliasTemplate) {
|
||||||
ICPPAliasTemplate aliasTemplate = (ICPPAliasTemplate) template;
|
ICPPAliasTemplate aliasTemplate = (ICPPAliasTemplate) template;
|
||||||
|
|
|
@ -1506,6 +1506,25 @@ public class CompletionTests extends AbstractContentAssistTest {
|
||||||
assertContentAssistResults(fCursorOffset, expected, true, ID);
|
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*/
|
// void foo() { Specialization<int, /*cursor*/
|
||||||
public void testTemplateArgumentList() throws Exception {
|
public void testTemplateArgumentList() throws Exception {
|
||||||
setCommaAfterFunctionParameter(CCorePlugin.INSERT);
|
setCommaAfterFunctionParameter(CCorePlugin.INSERT);
|
||||||
|
|
Loading…
Add table
Reference in a new issue