https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89214
--- Comment #11 from Marek Polacek ---
Author: mpolacek
Date: Mon Mar 25 16:38:48 2019
New Revision: 269919
URL: https://gcc.gnu.org/viewcvs?rev=269919=gcc=rev
Log:
PR c++/89214 - ICE when initializing aggregates with bases.
*
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89214
Marek Polacek changed:
What|Removed |Added
Keywords||patch
--- Comment #10 from Marek
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89214
--- Comment #9 from Marek Polacek ---
And a fix:
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -5978,6 +5978,18 @@ reshape_init_class (tree type, reshape_iter *d, bool
first_initializer_p,
field = next_initializable_field (DECL_CHAIN
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89214
--- Comment #8 from Marek Polacek ---
Another version, without a converting ctor:
struct B {
int c;
};
struct D : B { };
void
fn ()
{
D b{{D{42}}};
}
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89214
Marek Polacek changed:
What|Removed |Added
Status|NEW |ASSIGNED
Assignee|unassigned
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89214
--- Comment #7 from Marek Polacek ---
And an extended test:
// PR c++/89214
// { dg-do compile { target c++17 } }
struct A
{
A (int);
};
struct BB
{
A a;
};
struct B : BB
{
};
void
foo ()
{
B b1 = {42};
B b2 = {{42}};
B b3 =
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89214
--- Comment #6 from Marek Polacek ---
Somewhat cleaned up test:
struct A
{
A (int);
};
struct BB
{
A v;
};
struct B : BB
{};
B
foo ()
{
return {{B {{42;
}
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89214
--- Comment #5 from Marek Polacek ---
But we actually called reshape_init:
7146 expr = reshape_init (totype, expr, complain);
7147 expr = get_target_expr_sfinae (digest_init (totype, expr,
complain),
7148
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89214
Richard Biener changed:
What|Removed |Added
Keywords||ice-checking
Priority|P3
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89214
--- Comment #4 from Marek Polacek ---
(Your GCC 8 didn't ICE because that was configured with
--enable-checking=release.)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89214
--- Comment #3 from Marek Polacek ---
We're hitting
1198 /* "If T is a class type and the initializer list has a single
1199 element of type cv U, where U is T or a class derived from T,
1200 the object is initialized from that
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89214
Marek Polacek changed:
What|Removed |Added
Keywords||ice-on-valid-code
12 matches
Mail list logo