[Bug c++/53610] C++11: constructors accept silly initializers

barry.revzin at gmail dot com gcc-bugzilla@gcc.gnu.org
Thu Oct 24 16:43:00 GMT 2019


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

Barry Revzin <barry.revzin at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |barry.revzin at gmail dot com

--- Comment #3 from Barry Revzin <barry.revzin at gmail dot com> ---
Shorter reproduction:

struct S {
    S(int);
};

S s{.why = 42};

This still compiles on trunk, even with all warnings and -pedantic. 

Made for a very difficult-to-track down bug, since designated initializers are
a really nice way of mocking out named parameters (except when it's suddenly
not).


More information about the Gcc-bugs mailing list