https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110822
Jiang An <de34 at live dot cn> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |de34 at live dot cn --- Comment #3 from Jiang An <de34 at live dot cn> --- This example is valid (or should be) for libstdc++. Given `constexpr std::string text = "Some text here"s;` in namespace scope ("being a global variable"), the std::string object, which has static storage duration, contains a pointer to its subobject, and doesn't hold any pointer to a dynamically allocated storage. Clang complains that the _M_construct function is not defined at the call point so a call to it should make constant evalution fail. _M_construct is actually defined later (in basic_string.tcc IIUC). There's an unreolved CWG issue about this. https://cplusplus.github.io/CWG/issues/2166.html