@@ -2383,6 +2383,7 @@ finish_compound_literal (tree type, tree compound_literal,
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);
new file mode 100644
@@ -0,0 +1,9 @@
+// { dg-options -std=c++0x }
+
+struct A { ~A() = delete; }; // { dg-error "declared" }
+
+int main()
+{
+ typedef const A cA[2];
+ cA{}; // { dg-error "deleted" }
+}