Skip to content

Build error: ambiguous conversion for functional-style cast using Clang #580

Closed
@Naios

Description

933a33a

Currently I'm upgrading fmt 3.0.1 used by TrinityCore to version 4.0.0 and it seems
like the following error got introduced when using enums with an underlying type (of probably std::uint8_t):

enum SpellEffIndex : uint8 {
    EFFECT_0 = 0,
    EFFECT_1 = 1,
    EFFECT_2 = 2
};

int main() {
  fmt::sprintf("%u", EFFECT_0);
}

Note: the error was not reproducible when using MSVC 2017.

Travis Log:

/home/travis/build/Naios/TrinityCore/dep/fmt/fmt/format.h:2332:20: fatal error: ambiguous conversion for functional-style cast from 'const SpellEffIndex' to 'MakeValue<fmt::BasicFormatter<char, fmt::ArgFormatter<char> > >'
    Value result = MakeValue<Formatter>(value);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/travis/build/Naios/TrinityCore/dep/fmt/fmt/printf.h:546:1: note: in instantiation of function template specialization 'fmt::internal::ArgArray<7, true>::make<fmt::BasicFormatter<char, fmt::ArgFormatter<char> >, SpellEffIndex>' requested here
FMT_VARIADIC(std::string, sprintf, CStringRef)
^
/home/travis/build/Naios/TrinityCore/dep/fmt/fmt/format.h:3662:3: note: expanded from macro 'FMT_VARIADIC'
  FMT_VARIADIC_(char, ReturnType, func, return func, __VA_ARGS__)

Activity

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

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