commit d0334cc0204e8bff2aada54b8f9c73fdc3ebcd50
Author: Jason Merrill <jason@redhat.com>
Date: Tue Jul 10 01:42:02 2012 +0200
* method.c (synthesized_method_walk): Avoid changing
EH spec based on cleanups in other places, too.
@@ -1315,7 +1315,7 @@ synthesized_method_walk (tree ctype, special_function_kind sfk, bool const_p,
{
rval = locate_fn_flags (base_binfo, complete_dtor_identifier,
NULL_TREE, flags, complain);
- process_subob_fn (rval, false, spec_p, NULL,
+ process_subob_fn (rval, false, NULL, NULL,
deleted_p, NULL, NULL,
basetype);
}
@@ -1335,7 +1335,7 @@ synthesized_method_walk (tree ctype, special_function_kind sfk, bool const_p,
if (ctor_p)
walk_field_subobs (TYPE_FIELDS (ctype), complete_dtor_identifier,
sfk_destructor, TYPE_UNQUALIFIED, false,
- false, false, spec_p, NULL,
+ false, false, NULL, NULL,
deleted_p, NULL,
NULL, flags, complain);
@@ -14,7 +14,7 @@ struct B: A { };
// { dg-final { scan-assembler-not "_ZN1BC1Ev" } }
B b;
-struct C { C() noexcept; ~C(); };
+struct C { C() noexcept; ~C() noexcept(false); };
struct D: C { };
extern D d;
@@ -22,3 +22,11 @@ void *operator new(__SIZE_TYPE__, void*) noexcept;
#define SA(X) static_assert((X),#X)
SA(noexcept(new (&d) D));
+
+struct E: virtual C { };
+extern E e;
+SA(noexcept (new (&e) E));
+
+struct F { C c; };
+extern F f;
+SA(noexcept (new (&f) F));