[clang] [clang] implement current direction of CWG2765 for string literal comparisons in constant evaluation (PR #109208)

James Y Knight via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 20 09:59:38 PDT 2024


jyknight wrote:

I worry about string literals in vague-linkage entities, because the "version" of the string literal which is referred to from an inline-function/variable at runtime may not actually be the same version of the string literal seen in the current compilation -- at runtime we may in fact be using a different version of the symbol from another TU.

So, I think even a comparison of a string literal address with "the same version" cannot be guaranteed to be consistent with runtime.  Of course, this is already an issue, even without constexpr evaluation -- we make the same assumptions in the optimizer. So, maybe it's fine to continue ignoring this problem?

https://github.com/llvm/llvm-project/pull/109208


More information about the cfe-commits mailing list