[all-commits] [llvm/llvm-project] c0a8d9: [clang][P2719] Relax requirements for matching ope...

Oliver Hunt via All-commits all-commits at lists.llvm.org
Mon May 4 23:13:31 PDT 2026


  Branch: refs/heads/users/ojhunt/support-non-placement-type-aware-delete
  Home:   https://github.com/llvm/llvm-project
  Commit: c0a8d9f031cab7d07504475e99023be3ef25bc08
      https://github.com/llvm/llvm-project/commit/c0a8d9f031cab7d07504475e99023be3ef25bc08
  Author: Oliver Hunt <oliver at apple.com>
  Date:   2026-05-04 (Mon, 04 May 2026)

  Changed paths:
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/lib/Sema/SemaCoroutine.cpp
    M clang/lib/Sema/SemaDeclCXX.cpp
    M clang/lib/Sema/SemaExprCXX.cpp
    M clang/test/SemaCXX/type-aware-class-scoped-mismatched-constraints.cpp
    M clang/test/SemaCXX/type-aware-coroutines.cpp
    M clang/test/SemaCXX/type-aware-new-delete-basic-resolution.cpp
    M clang/test/SemaCXX/type-aware-placement-operators.cpp

  Log Message:
  -----------
  [clang][P2719] Relax requirements for matching operator new and delete

The most recent revision of P2719 introduced very strict rules about
matching parameter sets between type aware operators new and delete.

The intention was to resolve the classic "no matching operator delete
has been found so the object will silently leak" problem. The strict
rules however made deleting objects that had a placement new
"impossible".

I missed this however as all of our large scale tests involved
projects that were already using manually implemented allocators
(often trying to support type isolation). The problem with this from
a validation point of view is simple: all of these projects had
existing class scoped operators, and the untyped delete was silently
selected, avoiding the need for a non-placement type-aware delete
that would conflict with the placement cleanup delete.

The next revision of P2719 resolves this by removing the exact type
matching requirements and simply enforcing the intended semantics
directly: if a type aware allocation function is called and there
is a need for exception cleanup, it is an error if an appropriate
operator delete cannot be found.

This PR implements that behavior.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list