[all-commits] [llvm/llvm-project] fca4e2: Make dereferencing a void* a hard-error instead of...

Erich Keane via All-commits all-commits at lists.llvm.org
Wed May 24 11:27:28 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fca4e2add0f8b0471e4dbae5cf647006ec360bb2
      https://github.com/llvm/llvm-project/commit/fca4e2add0f8b0471e4dbae5cf647006ec360bb2
  Author: Erich Keane <erich.keane at intel.com>
  Date:   2023-05-24 (Wed, 24 May 2023)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/lib/Sema/SemaExpr.cpp
    M clang/test/CXX/temp/temp.decls/temp.class/temp.mem.func/p1inst.cpp
    M clang/test/SemaCXX/decl-expr-ambiguity.cpp
    M clang/test/SemaCXX/disallow_void_deref.cpp
    M clang/test/SemaCXX/reinterpret-cast.cpp

  Log Message:
  -----------
  Make dereferencing a void* a hard-error instead of warn-as-error

Clang 16 changed to consider dereferencing a void* to be a
warning-as-error, plus made this an error in SFINAE contexts, since this
resulted in incorrect template instantiation.  When doing so, the Clang
16 documentation was updated to reflect that this was likely to change
again to a non-disablable error in the next version.

As there has been no response to changing from a warning to an error, I
believe this is a non-controversial change.

This patch changes this to be an Error, consistent with the standard and
other compilers.

This was discussed in this RFC:
https://discourse.llvm.org/t/rfc-can-we-stop-the-extension-to-allow-dereferencing-void-in-c/65708

Differential Revision: https://reviews.llvm.org/D150875




More information about the All-commits mailing list