summaryrefslogtreecommitdiffstats
path: root/contrib/gcc
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2016-05-20 18:01:53 +0000
committerpfg <pfg@FreeBSD.org>2016-05-20 18:01:53 +0000
commit8d346526f93ee2d20743eff8e64d6b080d594e23 (patch)
treebef9d2a36bbeb5d9884cf5798db0966bee9b9e1a /contrib/gcc
parenta529b27f70a0ee40ea519f9a47bc7e0d29b92ff4 (diff)
downloadFreeBSD-src-8d346526f93ee2d20743eff8e64d6b080d594e23.zip
FreeBSD-src-8d346526f93ee2d20743eff8e64d6b080d594e23.tar.gz
GCC: Add support for named initializers for anonymous structs/unions.
Missing hunk from r300301. Reported by: Ed Schouten Obtained from: OpenBSD (CVS rev. 1.2)
Diffstat (limited to 'contrib/gcc')
-rw-r--r--contrib/gcc/c-typeck.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/contrib/gcc/c-typeck.c b/contrib/gcc/c-typeck.c
index 0e2e907..670c0ad 100644
--- a/contrib/gcc/c-typeck.c
+++ b/contrib/gcc/c-typeck.c
@@ -6074,13 +6074,24 @@ set_init_label (tree fieldname)
if (tail == 0)
error ("unknown field %qE specified in initializer", fieldname);
- else
+
+ while (tail)
{
constructor_fields = tail;
designator_depth++;
designator_erroneous = 0;
if (constructor_range_stack)
push_range_stack (NULL_TREE);
+
+ if (anon)
+ {
+ if (set_designator (0))
+ return;
+ tail = TREE_VALUE(anon);
+ anon = TREE_CHAIN(anon);
+ }
+ else
+ tail = NULL_TREE;
}
}
OpenPOWER on IntegriCloud