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

             Bug #: 51747
           Summary: [C++11] cannot call copy constructor using
                    list-initialization
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: r...@gcc.gnu.org
                CC: ja...@gcc.gnu.org


struct X {
   X() = default;
   X(const X&) = default;
#ifdef OK
   X(int) { }
#endif
};

X x;
X x2{x};

t.cc:10:7: error: too many initializers for 'X'

(It compiles fine if OK is defined.)

Should overload resolution choose the copy constructor?
If not, could there be a better diagnostic?

Reply via email to