[llvm-commits] [llvm-gcc-4.2] r41761 - /llvm-gcc-4.2/trunk/gcc/c-typeck.c
Bill Wendling
isanbard at gmail.com
Fri Sep 7 01:19:52 PDT 2007
Author: void
Date: Fri Sep 7 03:19:51 2007
New Revision: 41761
URL: http://llvm.org/viewvc/llvm-project?rev=41761&view=rev
Log:
A variable that's constant in a constructor shouldn't make the
constructor itself non-constant.
Modified:
llvm-gcc-4.2/trunk/gcc/c-typeck.c
Modified: llvm-gcc-4.2/trunk/gcc/c-typeck.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-typeck.c?rev=41761&r1=41760&r2=41761&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/c-typeck.c (original)
+++ llvm-gcc-4.2/trunk/gcc/c-typeck.c Fri Sep 7 03:19:51 2007
@@ -6453,7 +6453,13 @@
if (value == error_mark_node)
constructor_erroneous = 1;
- else if (!TREE_CONSTANT (value))
+ else if (!(TREE_CONSTANT (value)
+ || (DECL_P (value)
+ && DECL_INITIAL (value)
+ && DECL_INITIAL (value) != error_mark_node
+ && ! TREE_THIS_VOLATILE (value)
+ && ! TYPE_P (DECL_INITIAL (value))
+ && TREE_CONSTANT (DECL_INITIAL (value)))))
constructor_constant = 0;
else if (!initializer_constant_valid_p (value, TREE_TYPE (value))
|| ((TREE_CODE (constructor_type) == RECORD_TYPE
More information about the llvm-commits
mailing list