1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-09 18:56:02 +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

@ -8279,6 +8279,50 @@ public class AST2TemplateTests extends AST2TestBase {
parseAndCheckBindings(); 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> // template <typename T>
// struct A {}; // struct A {};
// //

View file

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