diff options
author | Jason Merrill <jason@redhat.com> | 2011-05-20 23:57:12 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2011-05-20 23:57:12 -0400 |
commit | c54a6b835913f97446cb0dfeb3c257009b61230e (patch) | |
tree | d09f7d2741ac7e2cfb4054b2bc01dec2e86b6209 | |
parent | 11436beb875ef83f8de7a1d264834a276c6a3a7a (diff) | |
download | gcc-c54a6b835913f97446cb0dfeb3c257009b61230e.zip gcc-c54a6b835913f97446cb0dfeb3c257009b61230e.tar.gz gcc-c54a6b835913f97446cb0dfeb3c257009b61230e.tar.bz2 |
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
-rw-r--r-- | gcc/cp/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/cp/decl.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 2 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/defaulted26.C | 7 |
4 files changed, 13 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 5aff296..0d1968f 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 91df9ee..eae7d8e 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -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. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c6d5615..d5fba0b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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. diff --git a/gcc/testsuite/g++.dg/cpp0x/defaulted26.C b/gcc/testsuite/g++.dg/cpp0x/defaulted26.C new file mode 100644 index 0000000..69bd0ac --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/defaulted26.C @@ -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" } |