mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 17:05:26 +02:00
Bug 487703 - Expansion of template template parameter pack
Change-Id: I9000357454c05f755e8cb6894216a19d4ced2116
This commit is contained in:
parent
8a39882870
commit
bd887e6800
2 changed files with 32 additions and 0 deletions
|
@ -8041,6 +8041,34 @@ public class AST2TemplateTests extends AST2TestBase {
|
|||
IVariable answer = helper.assertNonProblem("answer");
|
||||
assertVariableValue(answer, 1);
|
||||
}
|
||||
|
||||
|
||||
// template <template <class> class ... Mixins>
|
||||
// struct C : Mixins<int>... {};
|
||||
//
|
||||
// template <typename>
|
||||
// struct SpecificMixin {};
|
||||
//
|
||||
// constexpr bool answer = __is_base_of(SpecificMixin<int>, C<SpecificMixin>);
|
||||
public void testTemplateTemplateParameterPack_487703a() throws Exception {
|
||||
BindingAssertionHelper helper = getAssertionHelper();
|
||||
IVariable answer = helper.assertNonProblem("answer");
|
||||
assertVariableValue(answer, 1);
|
||||
}
|
||||
|
||||
// template <template <class> class ... Mixins>
|
||||
// struct C : Mixins<C<Mixins...>>... {};
|
||||
//
|
||||
// template <typename>
|
||||
// struct SpecificMixin {};
|
||||
//
|
||||
// typedef C<SpecificMixin> Waldo;
|
||||
// constexpr bool answer = __is_base_of(SpecificMixin<Waldo>, Waldo);
|
||||
public void testTemplateTemplateParameterPack_487703b() throws Exception {
|
||||
BindingAssertionHelper helper = getAssertionHelper();
|
||||
IVariable answer = helper.assertNonProblem("answer");
|
||||
assertVariableValue(answer, 1);
|
||||
}
|
||||
|
||||
// struct S {
|
||||
// void kind();
|
||||
|
|
|
@ -1202,6 +1202,10 @@ public class CPPTemplates {
|
|||
int r= PACK_SIZE_NOT_FOUND;
|
||||
if (binding instanceof ICPPDeferredClassInstance) {
|
||||
ICPPDeferredClassInstance dcl= (ICPPDeferredClassInstance) binding;
|
||||
if (dcl.getClassTemplate() instanceof ICPPTemplateTemplateParameter) {
|
||||
r = combinePackSize(r, determinePackSize((ICPPTemplateParameter) dcl.getClassTemplate(),
|
||||
tpMap));
|
||||
}
|
||||
ICPPTemplateArgument[] args = dcl.getTemplateArguments();
|
||||
for (ICPPTemplateArgument arg : args) {
|
||||
r= combinePackSize(r, determinePackSize(arg, tpMap));
|
||||
|
|
Loading…
Add table
Reference in a new issue