[libcxx-commits] [libcxx] [libcxx] Allow string to use SSO in constant evaluation. (PR #66576)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Wed Sep 20 19:56:06 PDT 2023


frederick-vs-ja wrote:

I think the warning should be triggered only if
- a `constexpr` or `constinit` object is a `basic_string` or contains a `basic_string` subobject, or
- the definition of a `constexpr` or `constinit` variable extends the lifetime of a temporary object that meets the previous condition.

For a `basic_string` variable of static/thread storage duration that is not declared with `constexpr` or `constinit` and happens to be constant-initialized, the warning seems undesired - as the definition itself is portable.

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


More information about the libcxx-commits mailing list