[Bug c++/88857] [7/8/9 Regression] ICE in build_value_init
mpolacek at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Jan 30 16:59:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88857
--- Comment #6 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #5)
> Indeed:
> class S { int a; };
> void foo (const S &, int);
>
> template <int N>
> void
> bar ()
> {
> foo ({});
> }
>
> With s/class/struct/ it doesn't ICE. build_value_init has an assertion that
> 346 /* The AGGR_INIT_EXPR tweaking below breaks in templates. */
> 347 gcc_assert (!processing_template_decl
> 348 || (SCALAR_TYPE_P (type) || TREE_CODE (type) == ARRAY_TYPE));
> So, shall convert_like_real just not call it at all if
> processing_template_decl?
Likely, or only for scalar types. This is the same problem I hit recently with
tweaking the narrowing detection. I could poke at this later, unless you want
it.
More information about the Gcc-bugs
mailing list