diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java index 10490e6fdcd..f1960630e02 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java @@ -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(); } diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTestBase.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTestBase.java index 6c1afa589cd..0cd20b5ca74 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTestBase.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTestBase.java @@ -224,4 +224,20 @@ public class CompletionTestBase extends AbstractContentAssistTest { // // template // using AliasForTemplateAlias = AliasForSpecialization; + // + // namespace bug521016 { + // template + // struct A { + // template + // struct AA { + // struct AAA { + // static void test(); + // }; + // }; + // }; + // + // struct B { + // using Test = A<0>::AA<0>; + // }; + // } } diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTests.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTests.java index ece1fdd3b10..2ceb03dddd6 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTests.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTests.java @@ -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 // 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(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() instead of just Base().