Skip to main content
summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorHannes Vogt2018-08-23 17:04:37 -0400
committerHannes Vogt2018-10-11 16:24:45 -0400
commit8492296d24dfacd63f21972fd7e91ffd806b250c (patch)
tree68b4f42d51bab4b012a420b572e12db035cc15ab /core
parentae8442fd6d7392dddfdfdc8202ad2834e8b9bea2 (diff)
downloadorg.eclipse.cdt-8492296d24dfacd63f21972fd7e91ffd806b250c.tar.gz
org.eclipse.cdt-8492296d24dfacd63f21972fd7e91ffd806b250c.tar.xz
org.eclipse.cdt-8492296d24dfacd63f21972fd7e91ffd806b250c.zip
Bug 538069 - Save non-type template parameter...
... of template template parameter in index. Fixes false positive "Invalid template arguments". Change-Id: I82cd9aece8f03142cbdcf5d1058113684c29d6fe Signed-off-by: Hannes Vogt <hannes@havogt.de>
Diffstat (limited to 'core')
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPTemplateResolutionTest.java12
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPTemplateTemplateParameter.java3
2 files changed, 15 insertions, 0 deletions
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPTemplateResolutionTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPTemplateResolutionTest.java
index 1011404ca2..987cef03ce 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPTemplateResolutionTest.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPTemplateResolutionTest.java
@@ -2223,6 +2223,18 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa
checkBindings();
}
+ // template <template <int... T1> class TT>
+ // struct my_template {
+ // };
+
+ // template<int...>
+ // struct my_type{};
+ //
+ // using foo = my_template<my_type>;
+ public void testTemplateTemplateNonTypeParameterPack_bug538069() throws Exception {
+ checkBindings();
+ }
+
// template<typename T>
// struct S {
// T t;
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPTemplateTemplateParameter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPTemplateTemplateParameter.java
index aeacb1e832..7abccb7072 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPTemplateTemplateParameter.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPTemplateTemplateParameter.java
@@ -43,6 +43,7 @@ import org.eclipse.cdt.internal.core.pdom.db.Database;
import org.eclipse.cdt.internal.core.pdom.db.PDOMNodeLinkedList;
import org.eclipse.cdt.internal.core.pdom.dom.PDOMLinkage;
import org.eclipse.cdt.internal.core.pdom.dom.PDOMNode;
+import org.eclipse.cdt.internal.core.pdom.dom.cpp.PDOMCPPLinkage.ConfigureTemplateParameters;
import org.eclipse.core.runtime.CoreException;
/**
@@ -76,6 +77,7 @@ public class PDOMCPPTemplateTemplateParameter extends PDOMCPPBinding
db.putInt(record + PARAMETERID, id);
final ICPPTemplateParameter[] origParams= param.getTemplateParameters();
final IPDOMCPPTemplateParameter[] params = PDOMTemplateParameterArray.createPDOMTemplateParameters(linkage, this, origParams);
+ ((PDOMCPPLinkage)linkage).new ConfigureTemplateParameters(origParams, params);
long rec= PDOMTemplateParameterArray.putArray(db, params);
getDB().putRecPtr(record + PARAMETERS, rec);
}
@@ -220,6 +222,7 @@ public class PDOMCPPTemplateTemplateParameter extends PDOMCPPBinding
IPDOMCPPTemplateParameter[] oldParams= getTemplateParameters();
try {
params= PDOMTemplateParameterArray.createPDOMTemplateParameters(getLinkage(), this, ttp.getTemplateParameters());
+ ((PDOMCPPLinkage)linkage).new ConfigureTemplateParameters(ttp.getTemplateParameters(), params);
long newRec= PDOMTemplateParameterArray.putArray(db, params);
db.putRecPtr(record + PARAMETERS, newRec);
if (oldRec != 0)

Back to the top