1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Bug 486425 - Decltype in pack expansion

Change-Id: I67dfbc295fab4674b95a9d61cf77d2329e1a0525
This commit is contained in:
Nathan Ridge 2016-01-25 00:00:42 -05:00 committed by Gerrit Code Review @ Eclipse.org
parent 8c96317ae8
commit 4fafaeaf10
2 changed files with 48 additions and 0 deletions

View file

@ -8278,6 +8278,50 @@ public class AST2TemplateTests extends AST2TestBase {
public void testMemberAccessViaReferenceInPackExpansion_466845() throws Exception {
parseAndCheckBindings();
}
// template <int... I>
// struct C {};
//
// template <class... T>
// struct B {
// typedef void type;
// };
//
// template <class T, int... I>
// typename B<decltype(T::template operator()<I>())...>::type
// waldo(T f, C<I...>);
//
// struct A {};
//
// void test() {
// A a;
// waldo(a, C<>()); // problem on waldo
// }
public void testDecltypeInPackExpansion_486425a() throws Exception {
parseAndCheckBindings();
}
// template <int... I>
// struct C {};
//
// template <class... T>
// struct B {
// typedef void type;
// };
//
// template <class T, int... I>
// typename B<decltype(T::template undefined<I>())...>::type
// waldo(T f, C<I...>);
//
// struct A {};
//
// void test() {
// A a;
// waldo(a, C<>()); // problem on waldo
// }
public void testDecltypeInPackExpansion_486425b() throws Exception {
parseAndCheckBindings();
}
// template <typename T>
// struct A {};

View file

@ -1120,6 +1120,10 @@ public class CPPTemplates {
if (type instanceof ICPPTemplateParameter) {
return determinePackSize((ICPPTemplateParameter) type, tpMap);
}
if (type instanceof TypeOfDependentExpression){
return ((TypeOfDependentExpression) type).getEvaluation().determinePackSize(tpMap);
}
if (type instanceof ICPPUnknownBinding) {
return determinePackSize((ICPPUnknownBinding) type, tpMap);