[all-commits] [llvm/llvm-project] aab25f: Never call a destroying operator delete when clean...

Richard Smith via All-commits all-commits at lists.llvm.org
Fri Jan 8 16:56:47 PST 2021


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: aab25fa7d853d6da960607310e2cd3e3a843d5a9
      https://github.com/llvm/llvm-project/commit/aab25fa7d853d6da960607310e2cd3e3a843d5a9
  Author: Richard Smith <richard at metafoo.co.uk>
  Date:   2021-01-08 (Fri, 08 Jan 2021)

  Changed paths:
    M clang/lib/Sema/SemaExprCXX.cpp
    M clang/test/CodeGenCXX/cxx2a-destroying-delete.cpp
    M clang/test/SemaCXX/cxx2a-destroying-delete.cpp

  Log Message:
  -----------
  Never call a destroying operator delete when cleaning up from an
exception thrown during construction in a new-expression.

Instead, when performing deallocation function lookup for a
new-expression, ignore all destroying operator delete candidates, and
fall back to global operator delete if there is no member operator
delete other than a destroying operator delete.

Use of destroying operator delete only makes sense when there is an
object to destroy, which there isn't in this case. The language wording
doesn't cover this case; this oversight has been reported to WG21, with
the approach in this patch as the proposed fix.




More information about the All-commits mailing list