[Bug c++/92745] [8/9/10 Regression] Initializing array with vec4 results in compile error
mpolacek at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Dec 16 16:04:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92745
--- Comment #6 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Potential fix:
--- gcc/cp/decl.c
+++ gcc/cp/decl.c
@@ -6408,11 +6408,11 @@ reshape_init_r (tree type, reshape_iter *d, bool
first_initializer_p,
/* For a nested compound literal, there is no need to reshape since
we called reshape_init in finish_compound_literal, before calling
digest_init. */
- else if (COMPOUND_LITERAL_P (stripped_init)
- /* Similarly, a CONSTRUCTOR of the target's type is a
- previously digested initializer. */
- || same_type_ignoring_top_level_qualifiers_p (type,
- init_type))
+ else if (COMPOUND_LITERAL_P (stripped_init))
+ gcc_assert (!BRACE_ENCLOSED_INITIALIZER_P (stripped_init));
+ /* Similarly, a CONSTRUCTOR of the target's type is a previously
+ digested initializer. */
+ else if (same_type_ignoring_top_level_qualifiers_p (type, init_type))
{
++d->cur;
gcc_assert (!BRACE_ENCLOSED_INITIALIZER_P (stripped_init));
More information about the Gcc-bugs
mailing list