From: Jason Merrill Date: Thu, 12 May 2022 21:38:40 +0000 (-0400) Subject: Revert "c++: designator and anon struct [PR101767]" X-Git-Tag: releases/gcc-10.4.0~140 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0807111e6347778910c9cf63521b7c838effceb8;p=thirdparty%2Fgcc.git Revert "c++: designator and anon struct [PR101767]" 101767 wasn't broken on the 10 branch, so it doesn't need the fix, just the test. PR c++/101767 This reverts commit 846bff4d4659d9b2026da574194599f38a00cc79. --- diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index a8fb9581cb28..99a4eb59ba8d 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -6251,11 +6251,6 @@ reshape_init_class (tree type, reshape_iter *d, bool first_initializer_p, return error_mark_node; } - if (!field && ANON_AGGR_TYPE_P (type)) - /* Apparently the designator isn't for a member of this anonymous - struct, so head back to the enclosing class. */ - break; - if (!field || TREE_CODE (field) != FIELD_DECL) { if (complain & tf_error)