[Bug c++/65154] [4.8/4.9/5 Regression] ICE with {} initialized array with string

2015-03-26 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65154

Jason Merrill  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED
   Target Milestone|4.8.5   |4.9.3

--- Comment #9 from Jason Merrill  ---
Fixed for 4.9.3/5.


[Bug c++/65154] [4.8/4.9/5 Regression] ICE with {} initialized array with string

2015-03-26 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65154

--- Comment #7 from Jason Merrill  ---
Author: jason
Date: Thu Mar 26 19:51:58 2015
New Revision: 221704

URL: https://gcc.gnu.org/viewcvs?rev=221704&root=gcc&view=rev
Log:
PR c++/65154
* init.c (build_vec_init): Fix initializing aggregates
with empty init list.

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


[Bug c++/65154] [4.8/4.9/5 Regression] ICE with {} initialized array with string

2015-03-26 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65154

--- Comment #8 from Jason Merrill  ---
Author: jason
Date: Thu Mar 26 19:52:00 2015
New Revision: 221705

URL: https://gcc.gnu.org/viewcvs?rev=221705&root=gcc&view=rev
Log:
PR c++/65154
* init.c (build_vec_init): Fix initializing aggregates
with empty init list.

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


[Bug c++/65154] [4.8/4.9/5 Regression] ICE with {} initialized array with string

2015-03-26 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65154

--- Comment #6 from Jason Merrill  ---
(In reply to Mikhail Maltsev from comment #5)
> We'll get 1000 calls to ss() in main instead of calling default c-tor of
> struct C. (which is probably not what we want).

Agreed, we ought to use the default constructor for {}-initialization when we
can.


[Bug c++/65154] [4.8/4.9/5 Regression] ICE with {} initialized array with string

2015-03-25 Thread maltsevm at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65154

--- Comment #5 from Mikhail Maltsev  ---
I have posted a patch for this bug:
https://gcc.gnu.org/ml/gcc-patches/2015-03/msg00026.html
But it reveals some latent bug (PR65503). In the following case (after applying
the patch):

struct ss {
ss() {};
};
struct C {
  ss s[1000];
};
int main() {
  C cs[5]{};
}

We'll get 1000 calls to ss() in main instead of calling default c-tor of struct
C. (which is probably not what we want).


[Bug c++/65154] [4.8/4.9/5 Regression] ICE with {} initialized array with string

2015-03-25 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65154

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org,
   ||jason at gcc dot gnu.org

--- Comment #4 from Jakub Jelinek  ---
Most likely started with r175674.


[Bug c++/65154] [4.8/4.9/5 Regression] ICE with {} initialized array with string

2015-03-25 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65154

Marek Polacek  changed:

   What|Removed |Added

   Target Milestone|--- |4.8.5
Summary|ICE with {} initialized |[4.8/4.9/5 Regression] ICE
   |array with string   |with {} initialized array
   ||with string

--- Comment #3 from Marek Polacek  ---
4.6 didn't ICE, thus a regression.