Constexpr evaluator should treat [[gnu::weak]] member pointer comparisons as evaluati...
authorTakuya Shimizu <shimizu2486@gmail.com>
Mon, 17 Apr 2023 13:48:58 +0000 (09:48 -0400)
committerAaron Ballman <aaron@aaronballman.com>
Mon, 17 Apr 2023 13:50:46 +0000 (09:50 -0400)
commita4edc2c9fa35a763fc5f4c9cf6383096a13a9cf6
treed6827dc60aef26e198410a31806c6ff162bd4762
parent8f3127cdea6e772954466554b3d51eeb6762270f
Constexpr evaluator should treat [[gnu::weak]] member pointer comparisons as evaluation failure

This patch fixes the wrong signal from the constexpr evaluator that
[[gnu::weak]] member pointer comparison is valid, while it is emitting
notes on them.

I found a crashing case fixed by this change and added it as a test
case: https://godbolt.org/z/8391fGjGn

I noticed this while I was working on D146358.

Differential Revision: https://reviews.llvm.org/D148419
clang/docs/ReleaseNotes.rst
clang/lib/AST/ExprConstant.cpp
clang/test/SemaCXX/crash-lambda-weak-attr.cpp [new file with mode: 0644]