re PR c++/49066 ([C++0x] Non-defining declaration of deleted function suppresses usage validation)

PR c++/49066
	* decl.c (duplicate_decls): Preserve DECL_DELETED_FN.

From-SVN: r173993
This commit is contained in:
Jason Merrill 2011-05-20 23:57:12 -04:00 committed by Jason Merrill
parent 11436beb87
commit c54a6b8359
4 changed files with 13 additions and 0 deletions

View File

@ -1,5 +1,8 @@
2011-05-20 Jason Merrill <jason@redhat.com>
PR c++/49066
* decl.c (duplicate_decls): Preserve DECL_DELETED_FN.
PR c++/48873
* tree.c (stabilize_expr): Fix typo.

View File

@ -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. */

View File

@ -1,5 +1,7 @@
2011-05-20 Jason Merrill <jason@redhat.com>
* g++.dg/cpp0x/defaulted26.C: New.
* g++.dg/cpp0x/noexcept02.C: Fix.
* g++.dg/cpp0x/noexcept03.C: Fix.
* g++.dg/cpp0x/noexcept08.C: Fix.

View File

@ -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" }