Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Ridge2018-11-27 02:00:10 -0500
committerNathan Ridge2018-12-05 14:34:40 -0500
commit089d7e1d6124620ff8900acfb238dcb40b7bd795 (patch)
tree0b2483603c873e1b178be29247dc283aa7a42e91 /core/org.eclipse.cdt.core.tests
parent3ee513f3240f9d542ef9524b4410946e5b1e14b0 (diff)
downloadorg.eclipse.cdt-089d7e1d6124620ff8900acfb238dcb40b7bd795.tar.gz
org.eclipse.cdt-089d7e1d6124620ff8900acfb238dcb40b7bd795.tar.xz
org.eclipse.cdt-089d7e1d6124620ff8900acfb238dcb40b7bd795.zip
Bug 541549 - Pack expansion expression in type of alias template
Alias templates can be instantiated with dependent arguments, which can themselves contain a pack expansion, so we need to take care that pack expansion expressions are instantiated correctly. This was previously fixed for pack expansions of types and template arguments in bug 486971. The patch also fixes a bug in CPPTypedef.getType() where alias declarations weren't handled correctly. (This bug would only occur during debugging as normally the type would be computed via setType(). Change-Id: Ie70a923fc9dd0f177b7bfb429b8f1387966b416d
Diffstat (limited to 'core/org.eclipse.cdt.core.tests')
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java17
1 files changed, 17 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 fb2861ea67d..e73f0ec9d8b 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
@@ -11123,6 +11123,23 @@ public class AST2TemplateTests extends AST2CPPTestBase {
parseAndCheckBindings();
}
+ // void foo(int);
+ //
+ // template <typename... T>
+ // using Res = decltype(foo(T()...));
+ //
+ // template <typename... T>
+ // struct Bind {
+ // using Type = Res<T...>;
+ // };
+ //
+ // using Waldo = Bind<int>::Type;
+ public void testPackExpansionExprInAliasTemplate_541549() throws Exception {
+ BindingAssertionHelper helper = getAssertionHelper();
+ IType waldo = helper.assertNonProblem("Waldo");
+ assertSameType(waldo, CommonCPPTypes.void_);
+ }
+
// template <class T>
// void foo(T = {});
//

Back to the top