public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "daniel.kruegler at googlemail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/53494] [4.7/4.8 Regression] ICE with invalid initializer list
Date: Tue, 29 May 2012 22:14:00 -0000 [thread overview]
Message-ID: <bug-53494-4-RdU6PVVVyI@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-53494-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53494
--- Comment #14 from Daniel Krügler <daniel.kruegler at googlemail dot com> 2012-05-29 21:16:57 UTC ---
(In reply to comment #13)
> Am I interpreting correctly that double braces are /required/ for std::array
> init lists but only when the subtype has has a multivariable initializer too?
I must agree that the compiler behaviour does not look correct to me. Initially
I thought that the reason is due to the fact, that brace-elision does not apply
here, but then I noticed that this code does not compile either:
struct pair
{
pair(const char*, int) { }
};
struct array_p
{
pair data[1];
};
array_p a = { { "smile", 1 } };
Here we have definitively brace elision in action, but I get the same error as
from Jonathan's example. My impression is that the compiler incorrectly does
not see the brace-elision case here.
Here is an example that works (with an expected [-Wmissing-braces] warning):
struct string
{
string(const char*) { }
};
struct array_s
{
string data[1];
};
array_s b{ "smile" };
From this I see that gcc already implements
http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1270
so I must conclude that the compiler should also accept the original example.
next prev parent reply other threads:[~2012-05-29 21:17 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-26 9:40 [Bug c++/53494] New: initializer lists in array type marcus-yass at ihug dot co.nz
2012-05-26 10:10 ` [Bug c++/53494] " paolo.carlini at oracle dot com
2012-05-26 14:54 ` redi at gcc dot gnu.org
2012-05-26 15:16 ` [Bug c++/53494] [4.7/4.8 Regression] ICE with invalid initializer list redi at gcc dot gnu.org
2012-05-26 17:06 ` paolo.carlini at oracle dot com
2012-05-26 20:32 ` marcus-yass at ihug dot co.nz
2012-05-26 21:13 ` paolo.carlini at oracle dot com
2012-05-26 21:47 ` marcus-yass at ihug dot co.nz
2012-05-28 16:17 ` paolo.carlini at oracle dot com
2012-05-28 16:25 ` redi at gcc dot gnu.org
2012-05-28 16:27 ` redi at gcc dot gnu.org
2012-05-28 16:32 ` paolo.carlini at oracle dot com
2012-05-28 16:41 ` paolo.carlini at oracle dot com
2012-05-28 21:42 ` marcus-yass at ihug dot co.nz
2012-05-29 10:29 ` rguenth at gcc dot gnu.org
2012-05-29 14:22 ` rguenth at gcc dot gnu.org
2012-05-29 22:14 ` daniel.kruegler at googlemail dot com [this message]
2012-05-29 22:33 ` paolo.carlini at oracle dot com
2012-05-29 23:15 ` paolo.carlini at oracle dot com
2012-05-29 23:36 ` redi at gcc dot gnu.org
2012-05-29 23:45 ` redi at gcc dot gnu.org
2012-05-30 6:47 ` daniel.kruegler at googlemail dot com
2012-05-30 8:31 ` redi at gcc dot gnu.org
2012-05-30 9:12 ` paolo.carlini at oracle dot com
2012-06-08 9:21 ` paolo.carlini at oracle dot com
2012-06-08 9:27 ` paolo.carlini at oracle dot com
2012-06-14 8:19 ` rguenth at gcc dot gnu.org
2012-08-06 11:58 ` paolo.carlini at oracle dot com
2012-08-06 15:42 ` paolo.carlini at oracle dot com
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-53494-4-RdU6PVVVyI@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: link
Be 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).