public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "rs2740 at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/60009] g++ allows copy-initialization of an array of class type from a non-braced string literal Date: Wed, 25 Jun 2014 04:21:00 -0000 [thread overview] Message-ID: <bug-60009-4-UTcZ5pWMxT@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-60009-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60009 TC <rs2740 at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rs2740 at gmail dot com --- Comment #1 from TC <rs2740 at gmail dot com> --- http://stackoverflow.com/questions/24378882/weird-gcc-array-initialization-behavior appears to be related. Minimal example: struct A { A() { } }; int main() { A a[10] = A(); } Compiles with GCC 4.6, 4.7, 4.8 and 4.9, in both C++98 and C++11 modes, even though it shouldn't. However, struct A { }; int main() { A a[10] = A(); } does not compile in any of the GCC versions tested. struct A { A() = default; }; int main() { A a[10] = A(); } Compiles with GCC 4.9 in C++11 mode; does not compile with 4.6-4.8 in C++ 11 mode, however.
next prev parent reply other threads:[~2014-06-25 4:21 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2014-01-31 14:52 [Bug c++/60009] New: " ed at catmur dot co.uk 2014-06-25 4:21 ` rs2740 at gmail dot com [this message] 2014-12-14 14:16 ` [Bug c++/60009] " ville.voutilainen at gmail dot com 2021-07-27 21:46 ` pinskia at gcc dot gnu.org 2021-10-06 18:42 ` ppalka at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-60009-4-UTcZ5pWMxT@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).