Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Woski2017-09-27 20:16:18 +0000
committerNathan Ridge2017-10-05 21:58:21 +0000
commita7be934ba2b0727b179b2328da82f8d863f0f6b4 (patch)
tree7851ff470eb59fa1d951ed727f00996c9fd46f75 /core/org.eclipse.cdt.ui.tests
parent89ebafa72e1e238c4a93bf076b5eb30cfd2845b7 (diff)
downloadorg.eclipse.cdt-a7be934ba2b0727b179b2328da82f8d863f0f6b4.tar.gz
org.eclipse.cdt-a7be934ba2b0727b179b2328da82f8d863f0f6b4.tar.xz
org.eclipse.cdt-a7be934ba2b0727b179b2328da82f8d863f0f6b4.zip
bug 525288 - resolve partial template specializations in
CSourceHover/OpenDeclaration Change-Id: I61c06fc453499ddc2b1af73a8a69d4b648d473c3 Signed-off-by: Michael Woski <woskimi@yahoo.de>
Diffstat (limited to 'core/org.eclipse.cdt.ui.tests')
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CPPSelectionTestsNoIndexer.java31
1 files changed, 29 insertions, 2 deletions
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CPPSelectionTestsNoIndexer.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CPPSelectionTestsNoIndexer.java
index e26473f76d4..6425171d0cb 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CPPSelectionTestsNoIndexer.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CPPSelectionTestsNoIndexer.java
@@ -45,6 +45,7 @@ import org.eclipse.cdt.core.testplugin.CProjectHelper;
import org.eclipse.cdt.core.testplugin.FileManager;
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
+import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTNameBase;
import org.eclipse.cdt.internal.ui.search.actions.OpenDeclarationsAction;
@@ -1353,15 +1354,41 @@ public class CPPSelectionTestsNoIndexer extends BaseSelectionTests {
public void testDependentAutoType_520913() throws Exception {
String code = getAboveComment();
IFile file = importFile("testBug520913a.cpp", code);
-
+
int offset = code.indexOf("auto test = ") + 2;
IASTNode target = testF3(file, offset);
assertInstance(target, IASTName.class);
assertEquals("AA", ((IASTName) target).toString());
-
+
offset = code.indexOf("auto test()") + 2;
target = testF3(file, offset);
assertInstance(target, IASTName.class);
assertEquals("AA", ((IASTName) target).toString());
}
+
+ // template<char T>
+ // struct A {};
+ //
+ // template<>
+ // struct A<0> {};
+ //
+ // void test(){
+ // A<0> a0;
+ // A<1> a1;
+ // }
+ public void testPartialSpecializationResolution_525288() throws Exception {
+ CPPASTNameBase.sAllowNameComputation = true;
+ String code = getAboveComment();
+ IFile file = importFile("testBug525288.cpp", code);
+
+ int offset = code.indexOf("a0") - 5;
+ IASTNode target = testF3(file, offset);
+ assertInstance(target, IASTName.class);
+ assertEquals("A<0>", ((IASTName) target).toString());
+
+ offset = code.indexOf("a1") - 5;
+ target = testF3(file, offset);
+ assertInstance(target, IASTName.class);
+ assertEquals("A", ((IASTName) target).toString());
+ }
}

Back to the top