https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85363
--- Comment #6 from Marek Polacek <mpolacek at gcc dot gnu.org> --- P::P () is marked as TREE_NOTHROW because when we're processing X::X ((struct X *) <<< Unknown tree: void_cst >>>, 20) (which can throw) in set_flags_from_callee, cfun is null in this case, so we don't mark P::P() as can_throw. If struct P were struct P { P () : x {5} {} X x; }; it would work as expected, because when processing X::X(), cfun would be non-null, so it would be marked as can_throw.