[all-commits] [llvm/llvm-project] 788731: [clang] Implement P3144R2 "Deleting a Pointer to a...

Vlad Serebrennikov via All-commits all-commits at lists.llvm.org
Fri Jul 5 11:27:25 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 788731cdbd732180639988c9589adbe63bb28afa
      https://github.com/llvm/llvm-project/commit/788731cdbd732180639988c9589adbe63bb28afa
  Author: Vlad Serebrennikov <serebrennikov.vladislav at gmail.com>
  Date:   2024-07-05 (Fri, 05 Jul 2024)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/Basic/DiagnosticGroups.td
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/lib/Sema/SemaExprCXX.cpp
    M clang/test/CXX/drs/cwg5xx.cpp
    M clang/test/OpenMP/deferred-diags.cpp
    M clang/test/SemaCXX/new-delete.cpp
    M clang/www/cxx_status.html

  Log Message:
  -----------
  [clang] Implement P3144R2 "Deleting a Pointer to an Incomplete Type..." (#97733)

This patch implements (not yet published)
[P3144R2](https://wiki.edg.com/pub/Wg21stlouis2024/StrawPolls/p3144r2.pdf)
"Deleting a Pointer to an Incomplete Type Should be Ill-formed". Wording
changes (not yet merged into the working draft) read:
> 7.6.2.9 [expr.delete] Delete
> If the object being deleted has incomplete class type at the point of
deletion <del>and the complete class has a
non-trivial destructor or a deallocation function, the behavior is
undefined</del>, <ins>the program is ill-formed</ins>.

We preserve status quo of emitting a warning when deleting a pointer to
incomplete type up to, and including, C++23, but make it ill-formed
since C++26. Same goes for deleting pointers to `void`, which has been
allowed as an extension.



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