diff options
author | Jason Merrill <jason@redhat.com> | 2010-06-05 00:52:07 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2010-06-05 00:52:07 -0400 |
commit | 247078ec4ddf45f168329c23187f480355b43f90 (patch) | |
tree | 288fa8d0d2d21f3c56feed6c85b284ab687e7616 /gcc/cp | |
parent | 4af89b884ccffe321856e11dc1a9f5f3e9fe2f60 (diff) | |
download | gcc-247078ec4ddf45f168329c23187f480355b43f90.zip gcc-247078ec4ddf45f168329c23187f480355b43f90.tar.gz gcc-247078ec4ddf45f168329c23187f480355b43f90.tar.bz2 |
typeck2.c (merge_exception_specifiers): Adjust merging of throw() and noexcept(true).
* typeck2.c (merge_exception_specifiers): Adjust merging of
throw() and noexcept(true).
From-SVN: r160308
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/cp/typeck2.c | 11 |
2 files changed, 7 insertions, 7 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index a67de73..b051079 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2010-06-04 Jason Merrill <jason@redhat.com> + * typeck2.c (merge_exception_specifiers): Adjust merging of + throw() and noexcept(true). + * pt.c (value_dependent_expression_p) [NOEXCEPT_EXPR]: Avoid using an uninitialized variable. diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c index 93ea70d..e7b97c4 100644 --- a/gcc/cp/typeck2.c +++ b/gcc/cp/typeck2.c @@ -1721,17 +1721,14 @@ merge_exception_specifiers (tree list, tree add) { if (!list || !add) return NULL_TREE; - /* A noexcept(true) spec takes precedence over a throw() spec. + /* For merging noexcept(true) and throw(), take the more recent one (LIST). A throw(type-list) spec takes precedence over a noexcept(false) spec. Any other noexcept-spec should only be merged with an equivalent one. - So the !TREE_VALUE code is correct for the latter two cases. */ - else if (list == noexcept_true_spec - || add == noexcept_true_spec) - return noexcept_true_spec; - else if (!TREE_VALUE (list)) - return add; + So the !TREE_VALUE code below is correct for all cases. */ else if (!TREE_VALUE (add)) return list; + else if (!TREE_VALUE (list)) + return add; else { tree orig_list = list; |