diff options
author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-07-21 16:18:38 +0000 |
---|---|---|
committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-07-21 16:18:38 +0000 |
commit | e88a1fbf6bb65809452216f99f9357c8d7a1c187 (patch) | |
tree | 33a80a666b17715e8060cd31b2e1722080dc01e2 /gcc/cp | |
parent | 4718112e4979ecd3b8cc8abbb7628b4303dfbf76 (diff) | |
download | gcc-e88a1fbf6bb65809452216f99f9357c8d7a1c187.tar.gz |
/cp
2008-07-21 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/36871
PR c++/36872
* semantics.c (classtype_has_nothrow_assign_or_copy_p): Only check
copy constructors and copy assignment operators proper.
/testsuite
2008-07-21 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/36871
PR c++/36872
* g++.dg/ext/has_nothrow_copy.C: Rename to...
* g++.dg/ext/has_nothrow_copy-1.C: ... this.
* g++.dg/ext/has_nothrow_copy-2.C: New.
* g++.dg/ext/has_nothrow_copy-3.C: Likewise.
* g++.dg/ext/has_nothrow_copy-4.C: Likewise.
* g++.dg/ext/has_nothrow_copy-5.C: Likewise.
* g++.dg/ext/has_nothrow_copy-6.C: Likewise.
* g++.dg/ext/has_nothrow_copy-7.C: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@138034 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cp/semantics.c | 16 |
2 files changed, 21 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 4e3bb4cd898..4f9e10c709d 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2008-07-21 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/36871 + PR c++/36872 + * semantics.c (classtype_has_nothrow_assign_or_copy_p): Only check + copy constructors and copy assignment operators proper. + 2008-07-21 Rafael Avila de Espindola <espindola@google.com> * parser.c (cp_token): Remove in_system_header. diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 3b91ddb0f90..ffa6493ced4 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -4677,8 +4677,20 @@ classtype_has_nothrow_assign_or_copy_p (tree type, bool assign_p) return false; for (; fns; fns = OVL_NEXT (fns)) - if (!TYPE_NOTHROW_P (TREE_TYPE (OVL_CURRENT (fns)))) - return false; + { + tree fn = OVL_CURRENT (fns); + + if (assign_p) + { + if (copy_fn_p (fn) == 0) + continue; + } + else if (copy_fn_p (fn) <= 0) + continue; + + if (!TYPE_NOTHROW_P (TREE_TYPE (fn))) + return false; + } return true; } |