[Bug c++/58089] New: expanding empty parameter pack as constructor arguments requires accessible copy constructor

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Aug 5 14:44:00 GMT 2013


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

            Bug ID: 58089
           Summary: expanding empty parameter pack as constructor
                    arguments requires accessible copy constructor
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org

struct X
{
    X() { }
private:
    X(const X& r);
};


template <typename... Args>
void f(Args&&... args)
{
    X t(args...);
}


int main()
{
    f();
}


$ g++ -std=gnu++11 t.cc
t.cc: In instantiation of 'void f(Args&& ...) [with Args = {}]':
t.cc:18:7:   required from here
t.cc:5:5: error: 'X::X(const X&)' is private
     X(const X& r);
     ^
t.cc:12:16: error: within this context
     X t(args...);
                ^



More information about the Gcc-bugs mailing list