diff options
Diffstat (limited to 'gcc/cp/constexpr.c')
-rw-r--r-- | gcc/cp/constexpr.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c index 4268141..19eb44f 100644 --- a/gcc/cp/constexpr.c +++ b/gcc/cp/constexpr.c @@ -1291,7 +1291,12 @@ adjust_temp_type (tree type, tree temp) return temp; /* Avoid wrapping an aggregate value in a NOP_EXPR. */ if (TREE_CODE (temp) == CONSTRUCTOR) - return build_constructor (type, CONSTRUCTOR_ELTS (temp)); + { + /* build_constructor wouldn't retain various CONSTRUCTOR flags. */ + tree t = copy_node (temp); + TREE_TYPE (t) = type; + return t; + } if (TREE_CODE (temp) == EMPTY_CLASS_EXPR) return build0 (EMPTY_CLASS_EXPR, type); gcc_assert (scalarish_type_p (type)); |