This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]