[all-commits] [llvm/llvm-project] 206757: [clang] Fix pointer comparisons between pointers t...

Eli Friedman via All-commits all-commits at lists.llvm.org
Thu Jul 17 08:56:50 PDT 2025


  Branch: refs/heads/release/21.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 2067574f54dd076fec4a5397bb2de7ad813e7e93
      https://github.com/llvm/llvm-project/commit/2067574f54dd076fec4a5397bb2de7ad813e7e93
  Author: Eli Friedman <efriedma at quicinc.com>
  Date:   2025-07-17 (Thu, 17 Jul 2025)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/AST/ExprConstant.cpp
    M clang/test/SemaCXX/constant-expression-cxx14.cpp
    M clang/test/SemaCXX/constant-expression-p2280r4.cpp

  Log Message:
  -----------
  [clang] Fix pointer comparisons between pointers to constexpr-unknown (#147663)

A constexpr-unknown reference can be equal to an arbitrary value, except
values allocated during constant evaluation. Fix the handling.

The standard is unclear exactly which pointer comparisons count as
"unknown" in this context; for example, in some cases we could use
alignment to prove two constexpr-unknown references are not equal. I
decided to ignore all the cases involving variables not allocated during
constant evaluation.

While looking at this, I also spotted that there might be issues with
lifetimes, but I didn't try to address it.

(cherry picked from commit 20c8e3c2a4744524396cc473a370cfb7855850b6)



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