Skip to content

fmt::v8: bigint build failure with clang-10 #2490

Description

@jcelerier
#define FMT_HEADER_ONLY
#include <fmt/format.h>
int main() 
{
  fmt::detail::bigint b;
  b.square();
}

causes

In file included from /opt/compiler-explorer/libs/fmt/trunk/include/fmt/format.h:2983:
/opt/compiler-explorer/libs/fmt/trunk/include/fmt/format-inl.h:557:49: error: variable of non-literal type 'basic_memory_buffer<fmt::v8::detail::bigint::bigit, bigits_capacity>' (aka 'basic_memory_buffer<unsigned int, bigits_capacity>') cannot be defined in a constexpr function
    basic_memory_buffer<bigit, bigits_capacity> n(std::move(bigits_));
                                                ^
/opt/compiler-explorer/libs/fmt/trunk/include/fmt/format.h:651:13: note: 'basic_memory_buffer<unsigned int, 32, std::allocator<unsigned int> >' is not literal because it has data member 'alloc_' of non-literal type 'std::allocator<unsigned int>'
  Allocator alloc_;
            ^

repro: https://godbolt.org/z/nT1TP4Wof ; maybe FMT_CONSTEXPR20 needs to start from clang-11 (where the above code compiles without issues)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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