Bug 35477 - Compiling error with template subclass of a variadic template class
Summary: Compiling error with template subclass of a variadic template class
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: ---
Assignee: Jason Merrill
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2008-03-05 21:34 UTC by Rodolfo Schulz de Lima
Modified: 2009-01-07 20:56 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2009-01-06 16:17:36


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rodolfo Schulz de Lima 2008-03-05 21:34:30 UTC
The following code fails to compile on gcc-4.3.0-RC2 with -std=c++0x

template <class...ARGS> struct tuple {};
template <class A, class B> struct test {};
template <class... ARGS, class B> struct test<B, tuple<ARGS...>>
{
    template <class T> struct inside {};
};

g++ exits saying:
error: parameter pack ‘ARGS’ must be at the end of the template parameter list

on line 5 (where struct inside is defined)

By removing the struct inside definition, it compiles fine.
Comment 1 Jason Merrill 2009-01-07 20:43:31 UTC
Subject: Bug 35477

Author: jason
Date: Wed Jan  7 20:43:01 2009
New Revision: 143166

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=143166
Log:
        PR c++/35297
        PR c++/35477
        PR c++/35784
        PR c++/36846
        PR c++/38276
        * pt.c (check_default_tmpl_args): Don't complain about
        out-of-order parameter packs in the enclosing class
        or parameter packs after default args.
        (coerce_template_parms): If we have more than one
        parameter pack, don't flatten argument packs.
        (template_args_equal): Handle argument packs.
        (comp_template_args): Don't flatten argument packs.
        (check_instantiated_arg): Split out from...
        (check_instantiated_args): Here.  Handle arg packs.
        (convert_template_argument): Just check that nontype argument
        packs have the right type.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/variadic92.C
    trunk/gcc/testsuite/g++.dg/cpp0x/variadic93.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/pt.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/cpp0x/variadic65.C
    trunk/gcc/testsuite/g++.dg/cpp0x/variadic82.C
    trunk/gcc/testsuite/g++.dg/cpp0x/variadic83.C

Comment 2 Jason Merrill 2009-01-07 20:56:43 UTC
Fixed.