[Bug c++/56633] Overload selection error for non-static data member initialization with initializer list in template class

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Mar 16 17:45:00 GMT 2013


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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-03-16
                 CC|                            |jason at gcc dot gnu.org
     Ever Confirmed|0                           |1
      Known to fail|                            |4.7.3

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2013-03-16 17:45:07 UTC ---
Confirmed

struct A {
  A(int) { }
  A(const A&) = delete;
};

struct Test1 {
    A value2{0}; // no problem here
};

template <typename T> // T is not used
struct Test2 {
    A value2{0}; // fails to compile
};

int main() {
    Test1 test;
    Test2<int> test2;
    return 0;
}



More information about the Gcc-bugs mailing list