From aa6b27d21b127fd9a294529cdf587b4e28b71bd8 Mon Sep 17 00:00:00 2001 From: meissner Date: Fri, 26 May 1995 15:03:12 +0000 Subject: [PATCH] Fix problem initializing bitfields to enums. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@9824 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/c-typeck.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 93a345edc56..9b73e970b85 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -4239,7 +4239,8 @@ initializer_constant_valid_p (value, endtype) switch (TREE_CODE (value)) { case CONSTRUCTOR: - if (TREE_CODE (TREE_TYPE (value)) == UNION_TYPE + if ((TREE_CODE (TREE_TYPE (value)) == UNION_TYPE + || TREE_CODE (TREE_TYPE (value)) == RECORD_TYPE) && TREE_CONSTANT (value)) return initializer_constant_valid_p (TREE_VALUE (CONSTRUCTOR_ELTS (value)), -- 2.11.4.GIT