On 2024-10-30 10:30, Dimitry Andric via Cygwin wrote:
On 30 Oct 2024, at 17:14, Csaba Ráduly via Cygwin 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?

Okay, sorry, I typoed an extra _ before _GLIBCXX_NOEXCEPT!

Cygwin gcc/g++ 13.3 is available as a test package; only with .4/.5 are gcc version features and fixes considered stable.

The build is requesting -std=gnu++20, so why is 11 ABI relevant?

As I want to use the latest language, why is gcc 4 compatible ABI *default* relevant?

What can I do in the package build to get g++ to not use the default but whatever is required to support the latest language?

Where can I find docs on these symbols and their meanings, uses, and settings?

--
Take care. Thanks, Brian Inglis              Calgary, Alberta, Canada

La perfection est atteinte                   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer     but when there is no more to cut
                                -- Antoine de Saint-Exupéry

--
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

Reply via email to