Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHannes Vogt2019-04-30 16:53:43 -0400
committerNathan Ridge2019-05-05 18:54:25 -0400
commit665f47395e441584cc79fa1955a77ba1411f6665 (patch)
treeb63515a5a72a039ab70c3b13d05d134744194ce3 /core/org.eclipse.cdt.core
parent2006e6cdf1065f08c313d54f8ba27ce56136e48c (diff)
downloadorg.eclipse.cdt-665f47395e441584cc79fa1955a77ba1411f6665.tar.gz
org.eclipse.cdt-665f47395e441584cc79fa1955a77ba1411f6665.tar.xz
org.eclipse.cdt-665f47395e441584cc79fa1955a77ba1411f6665.zip
Bug 546843 - Initialization from dependent argument
Create deferred functions for constructor calls with dependent arguments. Change-Id: I007dd4fd12c13acdcb39225b73051589f6dafad3 Signed-off-by: Hannes Vogt <hannes@havogt.de>
Diffstat (limited to 'core/org.eclipse.cdt.core')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java14
1 files changed, 14 insertions, 0 deletions
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 e899187cc0..2b20779a8f 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
@@ -3726,6 +3726,11 @@ public class CPPSemantics {
IType sourceType = evaluation.getType();
ValueCategory isLValue = evaluation.getValueCategory();
if (sourceType != null) {
+ if (CPPTemplates.isDependentType(sourceType)) {
+ IType[] tmp = { sourceType };
+ setTargetedFunctionsToUnknown(tmp);
+ return CPPDeferredFunction.createForCandidates(type.getConstructors());
+ }
Cost c;
if (calculateInheritanceDepth(sourceType, type) >= 0) {
c = Conversions.copyInitializationOfClass(isLValue, sourceType, type, false);
@@ -3747,6 +3752,15 @@ public class CPPSemantics {
// List initialization.
ICPPEvaluation eval = ((ICPPASTInitializerClause) initializer).getEvaluation();
if (eval instanceof EvalInitList) {
+ if (CPPTemplates.isDependentType(eval.getType())) {
+ ICPPEvaluation[] clauses = ((EvalInitList) eval).getClauses();
+ IType[] tmp = new IType[clauses.length];
+ for (int i = 0; i < clauses.length; i++) {
+ tmp[i] = clauses[i].getType();
+ }
+ setTargetedFunctionsToUnknown(tmp);
+ return CPPDeferredFunction.createForCandidates(type.getConstructors());
+ }
Cost c = Conversions.listInitializationSequence((EvalInitList) eval, type, UDCMode.ALLOWED, true);
if (c.converts()) {
ICPPFunction f = c.getUserDefinedConversion();

Back to the top