g++ 12 -std=gnu++20
Dimitry Andric
dimitry@unified-streaming.com
Wed Oct 30 16:30:14 GMT 2024
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
More information about the Cygwin
mailing list