diff options
author | Nathan Ridge | 2018-01-21 02:05:59 +0000 |
---|---|---|
committer | Nathan Ridge | 2018-01-28 08:37:03 +0000 |
commit | 5f9964098c21560cda659f4d81c01b57a648ad4f (patch) | |
tree | eaeddb6c114693b07d43b20192daab1013c4f4fa /core | |
parent | ee784263c237a99b54d919b2aa9737d87986a4fd (diff) | |
download | org.eclipse.cdt-5f9964098c21560cda659f4d81c01b57a648ad4f.tar.gz org.eclipse.cdt-5f9964098c21560cda659f4d81c01b57a648ad4f.tar.xz org.eclipse.cdt-5f9964098c21560cda659f4d81c01b57a648ad4f.zip |
Bug 530086 - Consider pack expansions when matching non-type arguments to parameters during instantiation
Alias templates can be instantiated with dependent arguments.
Change-Id: I123ee574ed2eecb09b551360a0bbc966893d9e34
Diffstat (limited to 'core')
2 files changed, 12 insertions, 0 deletions
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java index 98223b1759e..fa80afde3a1 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java @@ -10551,4 +10551,13 @@ public class AST2TemplateTests extends AST2CPPTestBase { public void testTemplateIdAmbiguity_529696() throws Exception { parseAndCheckBindings(); } + + // template <int...> + // using index_sequence = int; + // + // template <int... I> + // void foo(index_sequence<I...>); + public void testTemplateAliasWithVariadicNonTypeArgs_530086() throws Exception { + parseAndCheckBindings(); + } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPTemplates.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPTemplates.java index 58c6af7f199..b4915bb19c2 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPTemplates.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPTemplates.java @@ -2834,6 +2834,9 @@ public class CPPTemplates { final IType paramType, ICPPTemplateArgument arg) throws DOMException { // 14.1s8 function to pointer and array to pointer conversions. IType a= arg.getTypeOfNonTypeValue(); + if (a instanceof ICPPParameterPackType) { + a = ((ICPPParameterPackType) a).getType(); + } IType p; if (paramType instanceof IFunctionType) { p = new CPPPointerType(paramType); |