+2010-09-06 Jason Merrill <jason@redhat.com>
+
+ * semantics.c (finish_compound_literal): Always build a
+ TARGET_EXPR.
+
2010-08-30 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/45043
if (TREE_CODE (type) == ARRAY_TYPE)
cp_complete_array_type (&type, compound_literal, false);
compound_literal = digest_init (type, compound_literal);
- if ((!at_function_scope_p () || CP_TYPE_CONST_P (type))
- && initializer_constant_valid_p (compound_literal, type))
- {
- tree decl = create_temporary_var (type);
- DECL_INITIAL (decl) = compound_literal;
- TREE_STATIC (decl) = 1;
- cp_apply_type_quals_to_decl (cp_type_quals (type), decl);
- decl = pushdecl_top_level (decl);
- DECL_NAME (decl) = make_anon_name ();
- SET_DECL_ASSEMBLER_NAME (decl, DECL_NAME (decl));
- return decl;
- }
- else
- return get_target_expr (compound_literal);
+ return get_target_expr (compound_literal);
}
/* Return the declaration for the function-name variable indicated by
+2010-09-06 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp0x/initlist43.C: New.
+
2010-09-05 Giuseppe Scrivano <gscrivano@gnu.org>
* gcc.dg/tree-ssa/tailrecursion-7.c: New file.
--- /dev/null
+// Test that using T{} at file scope doesn't create a static temporary.
+// { dg-options -std=c++0x }
+// { dg-final { scan-assembler-not "local" } }
+
+struct A { };
+
+A a = A{};