[Bug c++/114123] list-initialization with a single element

2024-02-26 Thread yx_liu at hotmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114123 --- Comment #3 from Yaxun Liu --- So, since vector has a ctor that accepts initializer list, that ctor is favored over its copy ctor. With the initializer-list ctor, a is converted to A(a) first, then {A(a)} is passed to that ctor.

[Bug c++/114123] list-initialization with a single element

2024-02-26 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114123 --- Comment #2 from Andrew Pinski --- Also see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83264#c14 where Jason is pinging the CWG about the interactions here.

[Bug c++/114123] list-initialization with a single element

2024-02-26 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114123 --- Comment #1 from Andrew Pinski --- I think GCC's behavior here is correct, see PR 83264 . Specifically https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83264#c11 . And https://cplusplus.github.io/CWG/issues/1467.html .