summaryrefslogtreecommitdiff
path: root/gcc/cp/method.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2011-09-25 02:26:21 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2011-09-25 02:26:21 +0000
commit12391171646e4b26733105e8c31dc1dd7a77b9c6 (patch)
treede3aff190fb00a74f4653d3e14ea69ee68705f88 /gcc/cp/method.c
parentdb7c1fc63c4ccc50d501537ca704d668e7a9000b (diff)
downloadgcc-12391171646e4b26733105e8c31dc1dd7a77b9c6.tar.gz
* except.c (expr_noexcept_p): Split out from finish_noexcept_expr.
* cp-tree.h: Declare it. * method.c (walk_field_subobs): Use it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@179158 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/method.c')
-rw-r--r--gcc/cp/method.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index 734c23b0d6c..1316dfb6a83 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -1042,6 +1042,12 @@ walk_field_subobs (tree fields, tree fnname, special_function_kind sfk,
inform (0, "initializer for %q+#D is invalid", field);
if (trivial_p)
*trivial_p = false;
+ /* Core 1351: If the field has an NSDMI that could throw, the
+ default constructor is noexcept(false). FIXME this is
+ broken by deferred parsing and 1360 saying we can't
+ lazily declare a non-trivial default constructor. */
+ if (spec_p && !expr_noexcept_p (DECL_INITIAL (field), complain))
+ *spec_p = noexcept_false_spec;
/* Don't do the normal processing. */
continue;