Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning: msvc 16.10-pre3 clashes with {fmt} #2284

Closed
DanielaE opened this issue May 13, 2021 · 1 comment
Closed

Warning: msvc 16.10-pre3 clashes with {fmt} #2284

DanielaE opened this issue May 13, 2021 · 1 comment

Comments

@DanielaE
Copy link
Contributor

For some not yet investigated reason, <format> from the STL gets pulled into {fmt}'s test for compile.h. This might affect user code as well. Interesting times ...

Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30035 for x64
compile-test.cc
E:\fmt-module\fmtlib\include\fmt/compile.h(325): error C2668: 'std::make_format_args': ambiguous call to overloaded function
C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview-IDE\VC\Tools\MSVC\14.29.30035\include\format(2848): note: could be 'auto std::make_format_args<fmt::v7::basic_format_context<std::back_insert_iterator<std::string>,char>,_Ty>(const _Ty &)' [found using argument-dependent lookup]
        with
        [
            _Ty=std::chrono::duration<__std_tzdb_epoch_milli,std::milli>
        ]
E:\fmt-module\fmtlib\include\fmt\core.h(1640): note: or       'fmt::v7::format_arg_store<fmt::v7::basic_format_context<std::back_insert_iterator<std::string>,char>,_Ty> fmt::v7::make_format_args<fmt::v7::basic_format_context<std::back_insert_iterator<std::string>,char>,_Ty>(const _Ty &)'
        with
        [
            _Ty=std::chrono::duration<__std_tzdb_epoch_milli,std::milli>
        ]
E:\fmt-module\fmtlib\include\fmt/compile.h(323): note: while trying to match the argument list '(const _Ty)'
        with
        [
            _Ty=std::chrono::duration<__std_tzdb_epoch_milli,std::milli>
        ]
E:\fmt-module\fmtlib\include\fmt/compile.h(559): note: see reference to function template instantiation 'OutputIt fmt::v7::detail::spec_field<char_type,std::chrono::duration<__std_tzdb_epoch_milli,std::milli>,0>::format<std::back_insert_iterator<std::string>,_Ty>(OutputIt,const _Ty &) const' being compiled
        with
        [
            OutputIt=std::back_insert_iterator<std::string>,
            _Ty=std::chrono::duration<__std_tzdb_epoch_milli,std::milli>
        ]
E:\fmt-module\fmtlib\include\fmt/compile.h(561): note: see reference to function template instantiation 'OutputIt fmt::v7::detail::spec_field<char_type,std::chrono::duration<__std_tzdb_epoch_milli,std::milli>,0>::format<std::back_insert_iterator<std::string>,_Ty>(OutputIt,const _Ty &) const' being compiled
        with
        [
            OutputIt=std::back_insert_iterator<std::string>,
            _Ty=std::chrono::duration<__std_tzdb_epoch_milli,std::milli>
        ]
E:\fmt-module\fmtlib\include\fmt/compile.h(575): note: see reference to function template instantiation 'std::basic_string<char,std::char_traits<char>,std::allocator<char>> fmt::v7::format<T,_Ty,char,0>(const CompiledFormat &,const _Ty &)' being compiled
        with
        [
            T=fmt::v7::detail::spec_field<char_type,std::chrono::duration<__std_tzdb_epoch_milli,std::milli>,0>,
            _Ty=std::chrono::duration<__std_tzdb_epoch_milli,std::milli>,
            CompiledFormat=fmt::v7::detail::spec_field<char_type,std::chrono::duration<__std_tzdb_epoch_milli,std::milli>,0>
        ]
E:\fmt-module\fmtlib\test\compile-test.cc(97): note: see reference to function template instantiation 'std::basic_string<char,std::char_traits<char>,std::allocator<char>> fmt::v7::format<compile_test_format_specs_Test::TestBody::<lambda_2>::()::FMT_COMPILE_STRING,std::chrono::duration<__std_tzdb_epoch_milli,std::milli>,0>(const S &,std::chrono::duration<__std_tzdb_epoch_milli,std::milli> &&)' being compiled
        with
        [
            S=compile_test_format_specs_Test::TestBody::<lambda_2>::()::FMT_COMPILE_STRING
        ]
E:\fmt-module\fmtlib\include\fmt/compile.h(324): error C2530: 'vargs': references must be initialized
E:\fmt-module\fmtlib\include\fmt/compile.h(323): error C3536: 'vargs': cannot be used before it is initialized
E:\fmt-module\fmtlib\include\fmt/compile.h(326): error C2664: 'fmt::v7::basic_format_context<std::back_insert_iterator<std::string>,char>::basic_format_context(OutputIt,fmt::v7::basic_format_args<fmt::v7::basic_format_context<OutputIt,char>>,fmt::v7::detail::locale_ref)': cannot convert argument 2 from 'int' to 'fmt::v7::basic_format_args<fmt::v7::basic_format_context<std::back_insert_iterator<std::string>,char>>'
        with
        [
            OutputIt=std::back_insert_iterator<std::string>
        ]
E:\fmt-module\fmtlib\include\fmt/compile.h(323): note: No constructor could take the source type, or constructor overload resolution was ambiguous
E:\fmt-module\fmtlib\include\fmt\core.h(1536): note: see declaration of 'fmt::v7::basic_format_context<std::back_insert_iterator<std::string>,char>::basic_format_context'

Build failed.
@DanielaE
Copy link
Contributor Author

Injecting an #include <format> into every TU shows that this is the only place where such a clash in happening in the tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants