semantics.c (finish_compound_literal): Don't create a static variable inside cp_uneva...
authorJason Merrill <jason@redhat.com>
Wed, 30 Oct 2013 19:51:23 +0000 (15:51 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 30 Oct 2013 19:51:23 +0000 (15:51 -0400)
* semantics.c (finish_compound_literal): Don't create a static variable
inside cp_unevaluated_operand.

From-SVN: r204228

gcc/cp/ChangeLog
gcc/cp/semantics.c

index f71c239e58f3c5e7b5a96784bce72746d727cf65..ba55d805f9ea9be46c240418b4758b0e6f4817f8 100644 (file)
@@ -1,5 +1,8 @@
 2013-10-30  Jason Merrill  <jason@redhat.com>
 
+       * semantics.c (finish_compound_literal): Don't create a static variable
+       inside cp_unevaluated_operand.
+
        * init.c (push_base_cleanups): Check ANON_AGGR_TYPE_P.
 
 2013-10-30  Tobias Burnus  <burnus@net-b.de>
index e616196f7dcb39e8d34e1ef5486cf3a1306ab2f5..bbdf81ad961e600430b33d292cfc901bb00a1729 100644 (file)
@@ -2516,6 +2516,7 @@ finish_compound_literal (tree type, tree compound_literal,
   if ((!at_function_scope_p () || CP_TYPE_CONST_P (type))
       && TREE_CODE (type) == ARRAY_TYPE
       && !TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type)
+      && !cp_unevaluated_operand
       && initializer_constant_valid_p (compound_literal, type))
     {
       tree decl = create_temporary_var (type);