On Wed, 23 Aug 2023 at 18:35, François Dumont via Libstdc++ <libstd...@gcc.gnu.org> wrote: > > Hi > > The few tests that are failing in versioned namespace mode are due to > those friend declarations. > > This is a fix proposal even if I considered 2 other options: > > 1. Make __format::_Arg_store a struct and so do not bother with friend > declarations. > > 2. Consider it as a compiler bug and do nothing. In this case I think we > might still need this patch to avoid a non-working format library in > versioned namespace mode in gcc 14 if compiler bug is not fixed.
It definitely is a compiler bug, this is PR c++/59256. Please add a comment to the new macro definition, so we remember to remove it when it's not needed: #if _GLIBCXX_INLINE_VERSION // Needed because of PR c++/59526 # define _GLIBCXX_STD_V std::__8 #else # define _GLIBCXX_STD_V std #endif OK with that change, thanks. > > I can also define _GLIBCXX_STD_V at <format> level to limit impact. > > libstdc++: [_GLIBCXX_INLINE_VERSION] Fix <format> friend declarations > > GCC do not consider the inline namespace in friend declarations. We > need > to explicit this namespace. > > libstdc++-v3/ChangeLog: > > * include/bits/c++config (_GLIBCXX_STD_V): New macro giving > current > std namespace with optionally the version namespace. > * include/std/format (std::__format::_Arg_store): Use > latter on friend > declarations. > > Tested under versioned mode. > > Ok to commit ? > > François