[all-commits] [llvm/llvm-project] 9e5470: [Clang] Diagnose forming references to nullptr (#1...

Corentin Jabot via All-commits all-commits at lists.llvm.org
Wed Jul 16 05:25:45 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9e5470e7d6ea1ad4fe25a9416706d769e41a03c1
      https://github.com/llvm/llvm-project/commit/9e5470e7d6ea1ad4fe25a9416706d769e41a03c1
  Author: Corentin Jabot <corentinjabot at gmail.com>
  Date:   2025-07-16 (Wed, 16 Jul 2025)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/Basic/DiagnosticASTKinds.td
    M clang/lib/AST/ByteCode/State.h
    M clang/lib/AST/ExprConstant.cpp
    M clang/test/AST/ByteCode/complex.cpp
    M clang/test/AST/ByteCode/const-eval.c
    M clang/test/AST/ByteCode/cxx11.cpp
    M clang/test/AST/ByteCode/records.cpp
    M clang/test/CXX/drs/cwg14xx.cpp
    M clang/test/CXX/expr/expr.const/p2-0x.cpp
    M clang/test/Sema/const-eval.c
    M clang/test/SemaCXX/constant-expression-cxx11.cpp
    M clang/test/SemaCXX/constant-expression-cxx14.cpp
    M clang/test/SemaCXX/constant-expression-cxx2a.cpp
    M clang/test/SemaCXX/constexpr-backtrace-limit.cpp
    M libcxx/test/std/ranges/range.adaptors/range.zip/iterator/increment.pass.cpp

  Log Message:
  -----------
  [Clang] Diagnose forming references to nullptr (#143667)

Per [decl.ref],

> Because a null pointer value or a pointer past the end of an object
does not point to an object, a reference in a well-defined program
cannot refer to such things.

Note this does not fixes the new bytecode interpreter.

Fixes #48665



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