Skip to content

FMT_STATIC_THOUSANDS_SEPARATOR doesn't compile with GCC #1011

@alabuzhev

Description

@alabuzhev
#define FMT_STATIC_THOUSANDS_SEPARATOR <something>

Compilation error:

format.cc: In instantiation of 'fmt::v5::internal::locale_ref::locale_ref(const Locale&) [with Locale = std::locale]':
format.cc:12:73:   required from here
format.cc:12:73: error: explicit instantiation of 'fmt::v5::internal::locale_ref::locale_ref(const Locale&) [with Locale = std::locale]' but no definition available [-fpermissive]
 template FMT_API internal::locale_ref::locale_ref(const std::locale& loc);
                                                                         ^
format.cc: In instantiation of 'Locale fmt::v5::internal::locale_ref::get() const [with Locale = std::locale]':
format.cc:13:71:   required from here
format.cc:13:71: error: explicit instantiation of 'Locale fmt::v5::internal::locale_ref::get() const [with Locale = std::locale]' but no definition available [-fpermissive]
 template FMT_API std::locale internal::locale_ref::get<std::locale>() const;
                                                                       ^~~~~

Possible fix for format.cc:

FMT_BEGIN_NAMESPACE
template struct internal::basic_data<void>;
+ #if !defined(FMT_STATIC_THOUSANDS_SEPARATOR)
template FMT_API internal::locale_ref::locale_ref(const std::locale& loc);
template FMT_API std::locale internal::locale_ref::get<std::locale>() const;
+ #endif

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions