[Bug c++/52292] New: [C++11] Variadic template expansion into fixed template causes constructor to not match

leckey.ryan at gmail dot com gcc-bugzilla@gcc.gnu.org
Fri Feb 17 01:01:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52292

             Bug #: 52292
           Summary: [C++11] Variadic template expansion into fixed
                    template causes constructor to not match
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: leckey.ryan@gmail.com


The following should compile but fails with several errors about declaration
errors.

template <template <typename...> class T>
struct foo {
    template <typename... U>
    foo(T<U...> x) { }
};

template <typename T>
struct bar {
    bar(T x) : value(x) { }

    T value;
};

struct generic : private foo<bar> {
    template <typename T>
    generic(bar<T> x) : foo(x)
    {
    }

};

int main()
{
    bar<int> x(32);
    generic y(x); // FAILS
}

If you remove the '...' then everything works.



More information about the Gcc-bugs mailing list