On 30 Oct 2024, at 17:14, Csaba Ráduly via Cygwin <cygwin@cygwin.com> wrote: > > On 30/10/2024 17:00, Dimitry Andric via Cygwin wrote: >> #include<string> >> #include<cassert> >> >> constexpr bool foo() >> { >> std::string str2{"abcwe"}; >> return str2.size()==5; >> } >> >> static_assert(foo()); >> >> int main() >> { >> assert(foo()); >> } > > Seems like _GLIBCXX_USE_CXX11_ABI is not defined by default.
Indeed, /usr/lib/gcc/x86_64-pc-cygwin/12/include/c++/x86_64-pc-cygwin/bits/c++config.h shows: 317 # define _GLIBCXX_USE_DUAL_ABI 1 318 319 #if ! _GLIBCXX_USE_DUAL_ABI 320 // Ignore any pre-defined value of _GLIBCXX_USE_CXX11_ABI 321 # undef _GLIBCXX_USE_CXX11_ABI 322 #endif 323 324 #ifndef _GLIBCXX_USE_CXX11_ABI 325 # define _GLIBCXX_USE_CXX11_ABI 0 326 #endif Also, g++ -v shows --with-default-libstdcxx-abi=gcc4-compatible, so I guess this was deliberate on the part of the packagers. Probably for backwards compatibility reasons? -Dimitry -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple