aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/method.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2011-09-24 22:26:21 -0400
committerJason Merrill <jason@gcc.gnu.org>2011-09-24 22:26:21 -0400
commit6eaade31bbb647403677bc9c47ce8ee1dd67b514 (patch)
treede3aff190fb00a74f4653d3e14ea69ee68705f88 /gcc/cp/method.c
parent6fd44881415e619bc3daaa47f3012bb39beab0c8 (diff)
downloadgcc-6eaade31bbb647403677bc9c47ce8ee1dd67b514.zip
gcc-6eaade31bbb647403677bc9c47ce8ee1dd67b514.tar.gz
gcc-6eaade31bbb647403677bc9c47ce8ee1dd67b514.tar.bz2
except.c (expr_noexcept_p): Split out from finish_noexcept_expr.
* except.c (expr_noexcept_p): Split out from finish_noexcept_expr. * cp-tree.h: Declare it. * method.c (walk_field_subobs): Use it. From-SVN: r179158
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 734c23b..1316dfb 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;