[Bug c++/49669] [4.6/4.7 Regression] [C++0x] Compiler crashes with "internal compiler error: in perform_member_init, at cp/init.c:530"

2011-08-06 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49669

Paolo Carlini  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED

--- Comment #9 from Paolo Carlini  2011-08-06 
08:54:17 UTC ---
Fixed for 4.6.2 and 4.7.0.


[Bug c++/49669] [4.6/4.7 Regression] [C++0x] Compiler crashes with "internal compiler error: in perform_member_init, at cp/init.c:530"

2011-08-05 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49669

--- Comment #8 from Jason Merrill  2011-08-06 
04:38:19 UTC ---
Author: jason
Date: Sat Aug  6 04:38:16 2011
New Revision: 177501

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=177501
Log:
PR c++/49669
* init.c (perform_member_init): Handle invalid array initializer.

Added:
branches/gcc-4_6-branch/gcc/testsuite/g++.dg/init/array28.C
Modified:
branches/gcc-4_6-branch/gcc/cp/ChangeLog
branches/gcc-4_6-branch/gcc/cp/init.c
branches/gcc-4_6-branch/gcc/testsuite/ChangeLog


[Bug c++/49669] [4.6/4.7 Regression] [C++0x] Compiler crashes with "internal compiler error: in perform_member_init, at cp/init.c:530"

2011-08-05 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49669

--- Comment #7 from Jason Merrill  2011-08-06 
04:34:33 UTC ---
Author: jason
Date: Sat Aug  6 04:34:29 2011
New Revision: 177497

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=177497
Log:
PR c++/49669
* init.c (perform_member_init): Handle invalid array initializer.

Added:
trunk/gcc/testsuite/g++.dg/init/array28.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/init.c
trunk/gcc/testsuite/ChangeLog


[Bug c++/49669] [4.6/4.7 Regression] [C++0x] Compiler crashes with "internal compiler error: in perform_member_init, at cp/init.c:530"

2011-08-05 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49669

Jason Merrill  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 AssignedTo|unassigned at gcc dot   |jason at gcc dot gnu.org
   |gnu.org |

--- Comment #6 from Jason Merrill  2011-08-05 
21:22:33 UTC ---
TwoFoo z( { Foo(1), Foo(1) } );

is not valid; you can't copy-list-initialize a TwoFoo from { Foo(1), Foo(1) }
because brace elision is not allowed in that context.


[Bug c++/49669] [4.6/4.7 Regression] [C++0x] Compiler crashes with "internal compiler error: in perform_member_init, at cp/init.c:530"

2011-08-01 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49669

Richard Guenther  changed:

   What|Removed |Added

   Priority|P3  |P2


[Bug c++/49669] [4.6/4.7 Regression] [C++0x] Compiler crashes with "internal compiler error: in perform_member_init, at cp/init.c:530"

2011-07-07 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49669

Jonathan Wakely  changed:

   What|Removed |Added

 CC||jason at gcc dot gnu.org

--- Comment #5 from Jonathan Wakely  2011-07-07 
16:39:56 UTC ---
(In reply to comment #4)
> Say, since you're here, if I change the definition of x from "Foo[2]" to
> "std::array", should I be allowed to initialize it with
> 
>Goo::Goo() : x{{Foo(4), Foo(5)}} { }

I think that should be valid

> At the moment, _only_ the following seems to work:
> 
>Goo::Goo() : x({{Foo(4), Foo(5)}}) { }

Hmm, that creates a temporary array and uses that to initialize x, I
don't think that should be necessary.

> In particular, initialization of "Foo[2]" and "std::array" is anything
> but "uniform" :-)

It will never be completely uniform, because one is an array and one is an
aggregate containing an array, but I think any of these should be valid:

struct Foo { explicit Foo(int) { } };

struct TwoFoo { Foo elems[2]; };

TwoFoo x{ Foo(1), Foo(1) };
TwoFoo y{ { Foo(1), Foo(1) } };
TwoFoo z( { Foo(1), Foo(1) } );// ?

struct Goo
{
Foo a[2];
TwoFoo x, y, z;

Goo()
: a{ Foo(1), Foo(2) }
, x{ Foo(1), Foo(2) }
, y{ { Foo(1), Foo(2) } }
, z( { Foo(1), Foo(2) } )  // ?
{ }
};

Jason, when you get around to looking at this ICE, could you comment on the
initialization question above?  Thanks!


[Bug c++/49669] [4.6/4.7 Regression] [C++0x] Compiler crashes with "internal compiler error: in perform_member_init, at cp/init.c:530"

2011-07-07 Thread z0sh at sogetthis dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49669

--- Comment #4 from Kerrek SB  2011-07-07 16:09:55 
UTC ---
You're right, it works in 4.6.1 - thanks! (Just updated.)

Say, since you're here, if I change the definition of x from "Foo[2]" to
"std::array", should I be allowed to initialize it with

   Goo::Goo() : x{{Foo(4), Foo(5)}} { }

At the moment, _only_ the following seems to work:

   Goo::Goo() : x({{Foo(4), Foo(5)}}) { }

In particular, initialization of "Foo[2]" and "std::array" is anything
but "uniform" :-)


[Bug c++/49669] [4.6/4.7 Regression] [C++0x] Compiler crashes with "internal compiler error: in perform_member_init, at cp/init.c:530"

2011-07-07 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49669

Richard Guenther  changed:

   What|Removed |Added

   Target Milestone|--- |4.6.2


[Bug c++/49669] [4.6/4.7 Regression] [C++0x] Compiler crashes with "internal compiler error: in perform_member_init, at cp/init.c:530"

2011-07-07 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49669

--- Comment #3 from Jonathan Wakely  2011-07-07 
12:12:26 UTC ---
(In reply to comment #2)
> Yes, I know that the code is invalid, but that shouldn't make the compiler
> crash, should it?

No, that's why I confirmed the bug and marked it as a regression.

> For that matter, your proposed correct syntax is also rejected by 4.6.0:
> 
> Goo::Goo() : x{Foo(4), Foo(5)} { }
> 
> "error: invalid initializer for array member ‘Foo Goo::x [2]"

Yes, but it works with 4.6.1


[Bug c++/49669] [4.6/4.7 Regression] [C++0x] Compiler crashes with "internal compiler error: in perform_member_init, at cp/init.c:530"

2011-07-07 Thread z0sh at sogetthis dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49669

--- Comment #2 from Kerrek SB  2011-07-07 11:49:46 
UTC ---
Yes, I know that the code is invalid, but that shouldn't make the compiler
crash, should it?

For that matter, your proposed correct syntax is also rejected by 4.6.0:

Goo::Goo() : x{Foo(4), Foo(5)} { }

"error: invalid initializer for array member ‘Foo Goo::x [2]"


[Bug c++/49669] [4.6/4.7 Regression] [C++0x] Compiler crashes with "internal compiler error: in perform_member_init, at cp/init.c:530"

2011-07-07 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49669

Jonathan Wakely  changed:

   What|Removed |Added

   Keywords||ice-on-invalid-code
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2011.07.07 11:27:31
  Known to work||4.5.2
Summary|Compiler crashes with   |[4.6/4.7 Regression]
   |"internal compiler error:   |[C++0x] Compiler crashes
   |in perform_member_init, at  |with "internal compiler
   |cp/init.c:530"  |error: in
   ||perform_member_init, at
   ||cp/init.c:530"
 Ever Confirmed|0   |1
  Known to fail||4.6.1, 4.7.0

--- Comment #1 from Jonathan Wakely  2011-07-07 
11:27:31 UTC ---
The code is invalid, to initialize the array you need:
   x{Foo(4), Foo(5)} 

4.5 correctly rejects it:
b.cc: In constructor 'Goo::Goo()':
b.cc:2:38: error: bad array initializer