Cleanup FMT_STRING

This commit is contained in:
Victor Zverovich 2024-08-31 12:39:11 -07:00
parent 6797f0c39a
commit 516a2e2049
2 changed files with 15 additions and 16 deletions

View File

@ -65,8 +65,8 @@ jobs:
- name: Add repositories for older GCC
run: |
# Below repo provides GCC 4.9.
sudo apt-add-repository 'deb http://azure.archive.ubuntu.com/ubuntu/ xenial main'
sudo apt-add-repository 'deb http://azure.archive.ubuntu.com/ubuntu/ xenial universe'
sudo apt-add-repository 'deb http://dk.archive.ubuntu.com/ubuntu/ xenial main'
sudo apt-add-repository 'deb http://dk.archive.ubuntu.com/ubuntu/ xenial universe'
if: ${{ matrix.cxx == 'g++-4.9' }}
- name: Add repositories for newer GCC

View File

@ -1869,20 +1869,19 @@ inline auto find_escape(const char* begin, const char* end)
return result;
}
#define FMT_STRING_IMPL(s, base) \
[] { \
/* Use the hidden visibility as a workaround for a GCC bug (#1973). */ \
/* Use a macro-like name to avoid shadowing warnings. */ \
struct FMT_VISIBILITY("hidden") FMT_COMPILE_STRING : base { \
using char_type FMT_MAYBE_UNUSED = fmt::remove_cvref_t<decltype(s[0])>; \
FMT_MAYBE_UNUSED FMT_CONSTEXPR explicit \
operator fmt::basic_string_view<char_type>() const { \
return fmt::detail_exported::compile_string_to_view<char_type>(s); \
} \
}; \
typename FMT_COMPILE_STRING::char_type FMT_CHAR = {}; \
(void)FMT_CHAR; \
return FMT_COMPILE_STRING(); \
#define FMT_STRING_IMPL(s, base) \
[] { \
/* Use the hidden visibility as a workaround for a GCC bug (#1973). */ \
/* Use a macro-like name to avoid shadowing warnings. */ \
struct FMT_VISIBILITY("hidden") FMT_COMPILE_STRING : base { \
using char_type = fmt::remove_cvref_t<decltype(s[0])>; \
FMT_MAYBE_UNUSED FMT_CONSTEXPR explicit \
operator fmt::basic_string_view<char_type>() const { \
return fmt::detail_exported::compile_string_to_view<char_type>(s); \
} \
}; \
fmt::detail::ignore_unused(typename FMT_COMPILE_STRING::char_type()); \
return FMT_COMPILE_STRING(); \
}()
/**