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++/51747] [DR 1467] [C++11] cannot call defaulted copy constructor using list-initialization


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

--- Comment #10 from Ville Voutilainen <ville.voutilainen at gmail dot com> ---
This code fails with the current trunk:

struct B {};
struct D : B {D(B b) : B{b} {}};


base-aggr-init.cpp: In constructor âD::D(B)â:
base-aggr-init.cpp:2:27: error: too many initializers for âBâ
 struct D : B {D(B b) : B{b} {}};
                           ^

As far as I can see, the function process_init_constructor_record in typeck2.c 
emits the diagnostic.

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