commit 62d3da092d1252e7e0534fe2220c11b2050013e4
Author: Jason Merrill <jason@redhat.com>
Date: Fri May 20 18:05:46 2011 -0400
PR c++/49066
* decl.c (duplicate_decls): Preserve DECL_DELETED_FN.
@@ -1688,6 +1688,7 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
error ("deleted definition of %qD", newdecl);
error ("after previous declaration %q+D", olddecl);
}
+ DECL_DELETED_FN (newdecl) |= DECL_DELETED_FN (olddecl);
}
/* Deal with C++: must preserve virtual function table size. */
new file mode 100644
@@ -0,0 +1,7 @@
+// PR c++/49066
+// { dg-options -std=c++0x }
+
+void foo() = delete; // { dg-error "declared here" }
+void foo();
+
+int main() { foo(); } // { dg-error "deleted" }