https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65174

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2018-10-17
                 CC|                            |jason at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #1)
> Hmm, interesting. When the operand of the delete expression is null the
> destructor is not invoked, so it can't throw.

That's C++11 [expr.delete] p6

  If the value of the operand of the delete-expression is not a null pointer
  value, the delete-expression will invoke the destructor (if any) for the
  object or the elements of the array being deleted.

> It's not obvious to me whether
> GCC's result is allowed by the standard or not.

The question is whether GCC is correct to determine that the unevaluated
operand of the noexcept operator will not invoke a destructor. Although it's
true that it won't throw, deciding that seems to involve some evaluation of the
unevaluated operand.

Reply via email to