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

--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> ---
http://en.cppreference.com/w/cpp/language/list_initialization#Notes shows a
similar example, demonstrating the different behaviour for initializer_list
constructors. std::vector has an initializer-list constructor, so trying to
move-construct a vector<object_t> when object_t can be constructed from
std::vector<object_t> will result in infinite recursion.

This special case only applies to list-initialization, because it's related to
constructors taking a std::initializer_list. It's totally wrong to say that
list-init and direct-init must do the same thing in the presence of
initializer-list constructors. If they did the same thing there would have been
no need to introduce list-initialization syntax in the first place.

Reply via email to