1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Bug 521016 - resolution error for nested alias template specialization

from
index


Change-Id: Ia36f096cc4765341a62d8c6139a487c714854e97
Signed-off-by: Michael Woski <woskimi@yahoo.de>
This commit is contained in:
Michael Woski 2017-08-16 13:34:40 +02:00
parent 9011fe1a95
commit 709689b36e
3 changed files with 28 additions and 3 deletions

View file

@ -1989,7 +1989,7 @@ public class CPPSemantics {
// This is done to distinguish between left and right points for the same offset.
final int pointOfRef= ((ASTNode) node).getOffset() * 2;
ASTNode nd = null;
if (obj instanceof ICPPSpecialization) {
while (obj instanceof ICPPSpecialization) {
obj = ((ICPPSpecialization) obj).getSpecializedBinding();
}

View file

@ -224,4 +224,20 @@ public class CompletionTestBase extends AbstractContentAssistTest {
//
// template<typename T1, typename T2>
// using AliasForTemplateAlias = AliasForSpecialization<T1, T2>;
//
// namespace bug521016 {
// template <int TPA>
// struct A {
// template <int TPAA>
// struct AA {
// struct AAA {
// static void test();
// };
// };
// };
//
// struct B {
// using Test = A<0>::AA<0>;
// };
// }
}

View file

@ -606,6 +606,15 @@ public class CompletionTests extends CompletionTestBase {
assertCompletionResults(new String[] { "i" });
}
// namespace bug521016 {
// void test() {
// B::Test::AAA::/*cursor*/
// }
// }
public void testNestedAliasTemplateSpecialization_521016() throws Exception{
assertCompletionResults(new String[] { "test()" });
}
// template <typename TPA>
// struct A {
// enum class AA {
@ -1082,7 +1091,7 @@ public class CompletionTests extends CompletionTestBase {
// void test() {
// int alocal, blocal;
// if (alocal < b/*cursor*/
// if (alocal < bl/*cursor*/
public void testCompletionAfterLessThan_229062() throws Exception {
final String[] expected= { "blocal" };
assertCompletionResults(fCursorOffset, expected, REPLACEMENT);
@ -1181,7 +1190,7 @@ public class CompletionTests extends CompletionTestBase {
public void testConstructorInitializerList_EmptyInput_266586() throws Exception {
final String[] expected= { "mOne", "Base",
"Base(int)", "Base(const Base<Helper> &)", "Helper",
"Helper(void)", "Helper(const Helper &)", "_A_331056", "_B_331056",
"Helper(void)", "Helper(const Helper &)", "_A_331056", "_B_331056", "bug521016",
// Namespaces must be offered as well. In order for this code
// to compile with gcc (e.g. 4.1.2), you need to write
// ::ns::Base<Helper>() instead of just Base<Helper>().