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

Eli Friedman via All-commits all-commits at lists.llvm.org
Tue Jul 15 10:01:50 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 20c8e3c2a4744524396cc473a370cfb7855850b6
      https://github.com/llvm/llvm-project/commit/20c8e3c2a4744524396cc473a370cfb7855850b6
  Author: Eli Friedman <efriedma at quicinc.com>
  Date:   2025-07-15 (Tue, 15 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.



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