[Clang] Comparison between pointers to a string literal and some other object results in constant evaluation failure #92382
Labels
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
The following code snippet is incorrectly rejected by Clang (Godbolt link).
arr
is not a potentially non-unique object, so it must have a different address from that of string literal object"a"
, even though the latte is a potentially non-unique object. As a result,arr != "a"
has a specified result (true
), so the static assertion should be accepted.#49380 is related. But that issue involved comparison between pointers to different string literal objects, where it's very non-trivial to determine whether the result is unspecified.
The text was updated successfully, but these errors were encountered: