http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53494
Paolo Carlini changed:
What|Removed |Added
Status|ASSIGNED|RESOLVED
Resolution|
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53494
Paolo Carlini changed:
What|Removed |Added
CC||jwakely.gcc at gmail dot
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53494
Richard Guenther changed:
What|Removed |Added
Target Milestone|4.7.1 |4.7.2
--- Comment #23 from Richard Gue
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53494
--- Comment #22 from Paolo Carlini 2012-06-08
09:27:34 UTC ---
A tad simpler:
template
struct pair
{
T first;
U second;
pair(const T&, const U&);
};
template
struct array
{
typedef T value_type;
value_type data[1];
};
array const> m
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53494
--- Comment #21 from Paolo Carlini 2012-06-08
09:20:47 UTC ---
No includes:
template
struct pair
{
T first;
U second;
pair(const T&, const U&);
};
template
struct array
{
typedef T value_type;
value_type data[1];
};
struct string
{
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53494
Paolo Carlini changed:
What|Removed |Added
Status|NEW |ASSIGNED
AssignedTo|unassigned at
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53494
--- Comment #19 from Jonathan Wakely 2012-05-30
08:17:07 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 t
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53494
--- Comment #18 from Daniel Krügler
2012-05-30 06:25:27 UTC ---
(In reply to comment #16)
> "If the initializer-list begins with a left brace,"
>
> which it does
>
> "then the succeeding comma-separated list of initializer-clauses initializes
>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53494
--- Comment #17 from Jonathan Wakely 2012-05-29
23:36:02 UTC ---
clang version 3.2 (trunk 155804) also rejects it:
t.cc:11:18: error: no viable conversion from 'const char [6]' to 'pair'
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53494
--- Comment #16 from Jonathan Wakely 2012-05-29
23:34:14 UTC ---
(In reply to comment #14)
> struct pair
> {
> pair(const char*, int) { }
> };
>
> struct array_p
> {
> pair data[1];
> };
>
> array_p a = { { "smile", 1 } };
>
> Here we hav
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53494
--- Comment #15 from Paolo Carlini 2012-05-29
23:00:34 UTC ---
Thanks Daniel. Let's see if Jon agrees with your analysis. To be honest, at
first, when I figured out the workaround, it seemed a brace-elision issue to me
too, but then I haven't bee
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53494
Paolo Carlini changed:
What|Removed |Added
Status|ASSIGNED|NEW
AssignedTo|paolo.carlini at o
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53494
--- Comment #14 from Daniel Krügler
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 to
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53494
Richard Guenther changed:
What|Removed |Added
Priority|P3 |P5
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53494
Richard Guenther changed:
What|Removed |Added
Target Milestone|--- |4.7.1
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53494
--- Comment #13 from mako 2012-05-28 21:04:25
UTC ---
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?
..
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53494
--- Comment #12 from Paolo Carlini 2012-05-28
16:32:23 UTC ---
With checking disabled the error message comes out fine, thus the issue isn't
really urgent.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53494
Paolo Carlini changed:
What|Removed |Added
Status|NEW |ASSIGNED
AssignedTo|unassigned at
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53494
--- Comment #10 from Jonathan Wakely 2012-05-28
16:25:12 UTC ---
The code:
array a { { "smile", 1 } };
Attempts to initialize array with { { "smile", 1 } }
which attempts to initialize pair[2] with { "smile", 1 }
which fairly obviously atte
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53494
--- Comment #9 from Jonathan Wakely 2012-05-28
16:21:24 UTC ---
4.6 gets the error right, what you're doing is equivalent to:
struct pair
{
pair(const char*, int) { }
};
struct array
{
pair data[1];
};
array a { { "smile", 1 } };
And that
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53494
--- Comment #8 from Paolo Carlini 2012-05-28
16:11:29 UTC ---
"correctly rejects it" in general means "per the ISO C++ Standard, which we are
implementing, the testcase is invalid with diagnostics required, thus the
compiler is right in rejecting
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53494
--- Comment #7 from mako 2012-05-26 21:41:57
UTC ---
Uh, Johnathan said "4.6 correctly rejects it:", however 4.6's rejection message
appears every bit as useless as 4.7's, perhaps more so, because it
misattributes the error. If that's the correct
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53494
--- Comment #6 from Paolo Carlini 2012-05-26
21:00:21 UTC ---
Who said correct?!?
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53494
--- Comment #5 from mako 2012-05-26 20:31:39
UTC ---
Would someone please explain to me why that compile error is considered
correct? It tells me nothing sensible.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53494
--- Comment #4 from Paolo Carlini 2012-05-26
15:16:29 UTC ---
And since it's actually invalid should be pretty easy to fix, the ICE is
happening in a gcc_assert where alignment is handled, nothing to do.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53494
Jonathan Wakely changed:
What|Removed |Added
Known to work||4.6.3
Summary|initializer li
26 matches
Mail list logo