Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHannes Vogt2019-02-26 17:31:25 -0500
committerNathan Ridge2019-03-01 01:46:08 -0500
commit1370c76c3875d3d0ca88d81c8551f77d6d269dbd (patch)
tree4638d82b4d63e77816e9c09d07e54c312ee71dca /core/org.eclipse.cdt.core/parser/org/eclipse/cdt
parent4a35647d1f145ce64b5f07f0fba3681f5d3b359a (diff)
downloadorg.eclipse.cdt-1370c76c3875d3d0ca88d81c8551f77d6d269dbd.tar.gz
org.eclipse.cdt-1370c76c3875d3d0ca88d81c8551f77d6d269dbd.tar.xz
org.eclipse.cdt-1370c76c3875d3d0ca88d81c8551f77d6d269dbd.zip
Bug 544681 - Support for template<auto...>
Change-Id: I059d69ee86603c1aed95eeed1be61b915df6e3ed Signed-off-by: Hannes Vogt <hannes@havogt.de>
Diffstat (limited to 'core/org.eclipse.cdt.core/parser/org/eclipse/cdt')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateNonTypeParameter.java17
1 files changed, 13 insertions, 4 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateNonTypeParameter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateNonTypeParameter.java
index 9d960cdddb..3c881e2132 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateNonTypeParameter.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateNonTypeParameter.java
@@ -120,15 +120,24 @@ public class CPPTemplateNonTypeParameter extends CPPTemplateParameter implements
// C++17 template<auto>
if (type instanceof CPPPlaceholderType) {
- CPPDependentEvaluation eval = new EvalBinding(this, null, getPrimaryDeclaration());
- TypeOfDependentExpression replacementType = new TypeOfDependentExpression(eval);
- replacementType.setForTemplateAuto(true);
- type = replacementType;
+ type = getDependentTypeForAuto();
+ }
+ // template<auto...>
+ if (type instanceof CPPParameterPackType
+ && ((CPPParameterPackType) type).getType() instanceof CPPPlaceholderType) {
+ type = new CPPParameterPackType(getDependentTypeForAuto());
}
}
return type;
}
+ private IType getDependentTypeForAuto() {
+ CPPDependentEvaluation eval = new EvalBinding(this, null, getPrimaryDeclaration());
+ TypeOfDependentExpression replacementType = new TypeOfDependentExpression(eval);
+ replacementType.setForTemplateAuto(true);
+ return replacementType;
+ }
+
@Override
public boolean isParameterPack() {
return getType() instanceof ICPPParameterPackType;

Back to the top