gnu/gcc/34fd4c49fbe6ff643fc6f5f2cccca03c86535ee0 c++: clarify reshape_init designator handling
While looking at r17-3010, I found the handling of designators in
reshape_init* unclear, particularly in reshape_init_r. Jakub's patch
recurses directly from reshape_init_class to itself to avoid this confusion.
With this patch, if we see a designator in reshape_init_r, it designates a
member of TYPE, which means brace elision if !first_initializer_p. For this
to be true I needed to adjust reshape_init_array_1 to use
reshape_single_init from c++/103337. And then if we see a designator and
TYPE is a class or array, we know we're initializing an element so we don't
consider initializing TYPE directly.
gcc/cp/ChangeLog:
* decl.cc (reshape_single_init): Declare sooner.
(reshape_init_array_1): Use it.
(reshape_init_class): Drop "subclass" case.
(reshape_init_r): d->cur->index always means initializing
an element.
1 file changed