* semantics.c (finish_compound_literal): Don't put an array
with a dtor in a static variable.
From-SVN: r172810
2011-04-20 Jason Merrill <jason@redhat.com>
2011-04-20 Jason Merrill <jason@redhat.com>
+ * semantics.c (finish_compound_literal): Don't put an array
+ with a dtor in a static variable.
+
* call.c (build_over_call): Handle trivial dtor.
* search.c (lookup_fnfields_slot): Call complete_type.
* call.c (build_over_call): Handle trivial dtor.
* search.c (lookup_fnfields_slot): Call complete_type.
represent class temporaries with TARGET_EXPR so we elide copies. */
if ((!at_function_scope_p () || CP_TYPE_CONST_P (type))
&& TREE_CODE (type) == ARRAY_TYPE
represent class temporaries with TARGET_EXPR so we elide copies. */
if ((!at_function_scope_p () || CP_TYPE_CONST_P (type))
&& TREE_CODE (type) == ARRAY_TYPE
+ && !TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type)
&& initializer_constant_valid_p (compound_literal, type))
{
tree decl = create_temporary_var (type);
&& initializer_constant_valid_p (compound_literal, type))
{
tree decl = create_temporary_var (type);
2011-04-20 Jason Merrill <jason@redhat.com>
2011-04-20 Jason Merrill <jason@redhat.com>
+ * g++.dg/cpp0x/initlist47.C: New.
+
* g++.dg/init/dtor4.C: New.
2011-04-20 Uros Bizjak <ubizjak@gmail.com>
* g++.dg/init/dtor4.C: New.
2011-04-20 Uros Bizjak <ubizjak@gmail.com>
--- /dev/null
+// { dg-options -std=c++0x }
+
+struct A { ~A() = delete; }; // { dg-error "declared" }
+
+int main()
+{
+ typedef const A cA[2];
+ cA{}; // { dg-error "deleted" }
+}