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

Build error on GCC 7 #2359

Closed
phprus opened this issue Jun 14, 2021 · 5 comments
Closed

Build error on GCC 7 #2359

phprus opened this issue Jun 14, 2021 · 5 comments

Comments

@phprus
Copy link
Contributor

phprus commented Jun 14, 2021

Commit: https://github.com/fmtlib/fmt/tree/3c8fad126ced5e537014d4c50bb3617ee41c6373 - ERROR
Previous commit https://github.com/fmtlib/fmt/tree/f28cf3302d69fdaeb122be612b75b73bc0883b8a - is OK

CMake:

cmake -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 ..

Error:

[ 77%] Building CXX object test/CMakeFiles/compile-test.dir/compile-test.cc.o
cd /home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/build/test && /usr/bin/c++  -DFMT_LOCALE -DGTEST_HAS_STD_WSTRING=1 -D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING=1 -I/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include -isystem /home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/test/gtest/.  -O3 -DNDEBUG -fvisibility=hidden -fvisibility-inlines-hidden   -fno-delete-null-pointer-checks -std=gnu++1z -o CMakeFiles/compile-test.dir/compile-test.cc.o -c /home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/test/compile-test.cc
In file included from /home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/format.h:44:0,
                 from /home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h:11,
                 from /home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/test/compile-test.cc:8:
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h: In instantiation of ‘constexpr auto fmt::v7::detail::parse_replacement_field_then_tail(S) [with T = std::chrono::duration<double, std::ratio<1, 1000> >; Args = fmt::v7::detail::type_list<std::chrono::duration<double, std::ratio<1, 1000> > >; long unsigned int END_POS = 1; int ARG_INDEX = 0; int NEXT_ID = 1; S = compile_test_format_specs_Test::TestBody()::<lambda()>::FMT_COMPILE_STRING]’:
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h:463:69:   required from ‘constexpr auto fmt::v7::detail::compile_format_string(S) [with Args = fmt::v7::detail::type_list<std::chrono::duration<double, std::ratio<1, 1000> > >; long unsigned int POS = 0; int ID = 0; S = compile_test_format_specs_Test::TestBody()::<lambda()>::FMT_COMPILE_STRING]’
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h:525:72:   required from ‘constexpr auto fmt::v7::detail::compile(S) [with Args = {std::chrono::duration<double, std::ratio<1, 1000> >}; S = compile_test_format_specs_Test::TestBody()::<lambda()>::FMT_COMPILE_STRING; typename std::enable_if<fmt::v7::detail::is_compiled_string<S>::value, int>::type <anonymous> = 0]’
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h:570:53:   required from ‘std::__cxx11::basic_string<typename S::char_type> fmt::v7::format(const S&, Args&& ...) [with S = compile_test_format_specs_Test::TestBody()::<lambda()>::FMT_COMPILE_STRING; Args = {std::chrono::duration<double, std::ratio<1, 1000> >}; typename std::enable_if<fmt::v7::detail::is_compiled_string<S>::value, int>::type <anonymous> = 0; typename S::char_type = char; typename Context::char_type = char]’
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/test/compile-test.cc:108:3:   required from here
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h:437:70:   in constexpr expansion of ‘fmt::v7::detail::parse_specs<std::chrono::duration<double, std::ratio<1, 1000> >, char>(str, (1 + 1), (false ? 0 : 1))’
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h:381:8:   in constexpr expansion of ‘f.fmt::v7::formatter<std::chrono::duration<double, std::ratio<1, 1000> >, char, void>::parse(ctx)’
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/chrono.h:1244:26:   in constexpr expansion of ‘((fmt::v7::formatter<std::chrono::duration<double, std::ratio<1, 1000> >, char, void>*)this)->fmt::v7::formatter<std::chrono::duration<double, std::ratio<1, 1000> >, char, void>::do_parse(ctx)’
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/chrono.h:1225:32:   in constexpr expansion of ‘fmt::v7::detail::parse_width<char, fmt::v7::formatter<std::chrono::duration<double, std::ratio<1, 1000> >, char, void>::spec_handler&>(begin, end, handler)’
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/core.h:2229:43: error: ‘constexpr int fmt::v7::detail::parse_nonnegative_int(const Char*&, const Char*, ErrorHandler&&) [with Char = char; ErrorHandler = fmt::v7::formatter<std::chrono::duration<double, std::ratio<1, 1000> >, char, void>::spec_handler&]’ called in a constant expression
     handler.on_width(parse_nonnegative_int(begin, end, handler));
                      ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/core.h:2103:20: note: ‘constexpr int fmt::v7::detail::parse_nonnegative_int(const Char*&, const Char*, ErrorHandler&&) [with Char = char; ErrorHandler = fmt::v7::formatter<std::chrono::duration<double, std::ratio<1, 1000> >, char, void>::spec_handler&]’ is not usable as a constexpr function because:
 FMT_CONSTEXPR auto parse_nonnegative_int(const Char*& begin, const Char* end,
                    ^~~~~~~~~~~~~~~~~~~~~
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/core.h:2123:3: error: call to non-constexpr function ‘void fmt::v7::formatter<std::chrono::duration<_Rep1, _Period1>, Char>::spec_handler::on_error(const char*) [with Rep = double; Period = std::ratio<1, 1000>; Char = char]’
   eh.on_error("number is too big");
   ^~
In file included from /home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/test/compile-test.cc:8:0:
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h:439:60: error: no matching function for call to ‘parse_tail<fmt::v7::detail::type_list<std::chrono::duration<double, std::ratio<1, 1000> > >, result.fmt::v7::detail::parse_specs_result<std::chrono::duration<double, std::ratio<1, 1000> >, char>::end, result.fmt::v7::detail::parse_specs_result<std::chrono::duration<double, std::ratio<1, 1000> >, char>::next_arg_id>(fmt::v7::detail::spec_field<char, std::chrono::duration<double, std::ratio<1, 1000> >, 0>, compile_test_format_specs_Test::TestBody()::<lambda()>::FMT_COMPILE_STRING&)’
     return parse_tail<Args, result.end, result.next_arg_id>(
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
         spec_field<char_type, typename field_type<T>::type, ARG_INDEX>{
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
             result.fmt},
             ~~~~~~~~~~~~
         format_str);
         ~~~~~~~~~~~
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h:353:16: note: candidate: template<class Args, long unsigned int POS, int ID, class T, class S> constexpr auto fmt::v7::detail::parse_tail(T, S)
 constexpr auto parse_tail(T head, S format_str) {
                ^~~~~~~~~~
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h:353:16: note:   template argument deduction/substitution failed:
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h: In instantiation of ‘constexpr auto fmt::v7::detail::compile(S) [with Args = {std::chrono::duration<double, std::ratio<1, 1000> >}; S = compile_test_format_specs_Test::TestBody()::<lambda()>::FMT_COMPILE_STRING; typename std::enable_if<fmt::v7::detail::is_compiled_string<S>::value, int>::type <anonymous> = 0]’:
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h:570:53:   required from ‘std::__cxx11::basic_string<typename S::char_type> fmt::v7::format(const S&, Args&& ...) [with S = compile_test_format_specs_Test::TestBody()::<lambda()>::FMT_COMPILE_STRING; Args = {std::chrono::duration<double, std::ratio<1, 1000> >}; typename std::enable_if<fmt::v7::detail::is_compiled_string<S>::value, int>::type <anonymous> = 0; typename S::char_type = char; typename Context::char_type = char]’
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/test/compile-test.cc:108:3:   required from here
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h:524:20: error: ‘constexpr const void result’ has incomplete type
     constexpr auto result =
                    ^~~~~~
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h:527:12: error: unable to deduce ‘auto’ from ‘result’
     return result;
            ^~~~~~
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h: In instantiation of ‘std::__cxx11::basic_string<typename S::char_type> fmt::v7::format(const S&, Args&& ...) [with S = compile_test_format_specs_Test::TestBody()::<lambda()>::FMT_COMPILE_STRING; Args = {std::chrono::duration<double, std::ratio<1, 1000> >}; typename std::enable_if<fmt::v7::detail::is_compiled_string<S>::value, int>::type <anonymous> = 0; typename S::char_type = char; typename Context::char_type = char]’:
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/test/compile-test.cc:108:3:   required from here
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h:570:18: error: ‘constexpr const void compiled’ has incomplete type
   constexpr auto compiled = detail::compile<Args...>(S());
                  ^~~~~~~~
In file included from /home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/format.h:44:0,
                 from /home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h:11,
                 from /home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/test/compile-test.cc:8:
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h: In instantiation of ‘constexpr auto fmt::v7::detail::parse_replacement_field_then_tail(S) [with T = std::chrono::duration<double, std::ratio<1, 1000> >; Args = fmt::v7::detail::type_list<int, std::chrono::duration<double, std::ratio<1, 1000> > >; long unsigned int END_POS = 6; int ARG_INDEX = 1; int NEXT_ID = -1; S = compile_test_manual_ordering_Test::TestBody()::<lambda()>::FMT_COMPILE_STRING]’:
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h:479:80:   required from ‘constexpr auto fmt::v7::detail::compile_format_string(S) [with Args = fmt::v7::detail::type_list<int, std::chrono::duration<double, std::ratio<1, 1000> > >; long unsigned int POS = 4; int ID = -1; S = compile_test_manual_ordering_Test::TestBody()::<lambda()>::FMT_COMPILE_STRING]’
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h:356:63:   required from ‘constexpr auto fmt::v7::detail::parse_tail(T, S) [with Args = fmt::v7::detail::type_list<int, std::chrono::duration<double, std::ratio<1, 1000> > >; long unsigned int POS = 4; int ID = -1; T = fmt::v7::detail::code_unit<char>; S = compile_test_manual_ordering_Test::TestBody()::<lambda()>::FMT_COMPILE_STRING]’
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h:511:39:   required from ‘constexpr auto fmt::v7::detail::compile_format_string(S) [with Args = fmt::v7::detail::type_list<int, std::chrono::duration<double, std::ratio<1, 1000> > >; long unsigned int POS = 3; int ID = -1; S = compile_test_manual_ordering_Test::TestBody()::<lambda()>::FMT_COMPILE_STRING]’
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h:356:63:   required from ‘constexpr auto fmt::v7::detail::parse_tail(T, S) [with Args = fmt::v7::detail::type_list<int, std::chrono::duration<double, std::ratio<1, 1000> > >; long unsigned int POS = 3; int ID = -1; T = fmt::v7::detail::field<char, int, 0>; S = compile_test_manual_ordering_Test::TestBody()::<lambda()>::FMT_COMPILE_STRING]’
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h:433:50:   required from ‘constexpr auto fmt::v7::detail::parse_replacement_field_then_tail(S) [with T = int; Args = fmt::v7::detail::type_list<int, std::chrono::duration<double, std::ratio<1, 1000> > >; long unsigned int END_POS = 2; int ARG_INDEX = 0; int NEXT_ID = -1; S = compile_test_manual_ordering_Test::TestBody()::<lambda()>::FMT_COMPILE_STRING]’
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h:479:80:   required from ‘constexpr auto fmt::v7::detail::compile_format_string(S) [with Args = fmt::v7::detail::type_list<int, std::chrono::duration<double, std::ratio<1, 1000> > >; long unsigned int POS = 0; int ID = 0; S = compile_test_manual_ordering_Test::TestBody()::<lambda()>::FMT_COMPILE_STRING]’
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h:525:72:   required from ‘constexpr auto fmt::v7::detail::compile(S) [with Args = {int, std::chrono::duration<double, std::ratio<1, 1000> >}; S = compile_test_manual_ordering_Test::TestBody()::<lambda()>::FMT_COMPILE_STRING; typename std::enable_if<fmt::v7::detail::is_compiled_string<S>::value, int>::type <anonymous> = 0]’
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h:570:53:   required from ‘std::__cxx11::basic_string<typename S::char_type> fmt::v7::format(const S&, Args&& ...) [with S = compile_test_manual_ordering_Test::TestBody()::<lambda()>::FMT_COMPILE_STRING; Args = {int, std::chrono::duration<double, std::ratio<1, 1000> >}; typename std::enable_if<fmt::v7::detail::is_compiled_string<S>::value, int>::type <anonymous> = 0; typename S::char_type = char; typename Context::char_type = char]’
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/test/compile-test.cc:129:3:   required from here
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h:437:70:   in constexpr expansion of ‘fmt::v7::detail::parse_specs<std::chrono::duration<double, std::ratio<1, 1000> >, char>(str, (6 + 1), (true ? 0 : -1))’
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h:381:8:   in constexpr expansion of ‘f.fmt::v7::formatter<std::chrono::duration<double, std::ratio<1, 1000> >, char, void>::parse(ctx)’
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/chrono.h:1244:26:   in constexpr expansion of ‘((fmt::v7::formatter<std::chrono::duration<double, std::ratio<1, 1000> >, char, void>*)this)->fmt::v7::formatter<std::chrono::duration<double, std::ratio<1, 1000> >, char, void>::do_parse(ctx)’
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/chrono.h:1225:32:   in constexpr expansion of ‘fmt::v7::detail::parse_width<char, fmt::v7::formatter<std::chrono::duration<double, std::ratio<1, 1000> >, char, void>::spec_handler&>(begin, end, handler)’
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/core.h:2229:43: error: ‘constexpr int fmt::v7::detail::parse_nonnegative_int(const Char*&, const Char*, ErrorHandler&&) [with Char = char; ErrorHandler = fmt::v7::formatter<std::chrono::duration<double, std::ratio<1, 1000> >, char, void>::spec_handler&]’ called in a constant expression
     handler.on_width(parse_nonnegative_int(begin, end, handler));
                      ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
In file included from /home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/test/compile-test.cc:8:0:
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h:439:60: error: no matching function for call to ‘parse_tail<fmt::v7::detail::type_list<int, std::chrono::duration<double, std::ratio<1, 1000> > >, result.fmt::v7::detail::parse_specs_result<std::chrono::duration<double, std::ratio<1, 1000> >, char>::end, result.fmt::v7::detail::parse_specs_result<std::chrono::duration<double, std::ratio<1, 1000> >, char>::next_arg_id>(fmt::v7::detail::spec_field<char, std::chrono::duration<double, std::ratio<1, 1000> >, 1>, compile_test_manual_ordering_Test::TestBody()::<lambda()>::FMT_COMPILE_STRING&)’
     return parse_tail<Args, result.end, result.next_arg_id>(
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
         spec_field<char_type, typename field_type<T>::type, ARG_INDEX>{
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
             result.fmt},
             ~~~~~~~~~~~~
         format_str);
         ~~~~~~~~~~~
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h:353:16: note: candidate: template<class Args, long unsigned int POS, int ID, class T, class S> constexpr auto fmt::v7::detail::parse_tail(T, S)
 constexpr auto parse_tail(T head, S format_str) {
                ^~~~~~~~~~
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h:353:16: note:   template argument deduction/substitution failed:
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h: In instantiation of ‘constexpr auto fmt::v7::detail::parse_tail(T, S) [with Args = fmt::v7::detail::type_list<int, std::chrono::duration<double, std::ratio<1, 1000> > >; long unsigned int POS = 4; int ID = -1; T = fmt::v7::detail::code_unit<char>; S = compile_test_manual_ordering_Test::TestBody()::<lambda()>::FMT_COMPILE_STRING]’:
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h:511:39:   required from ‘constexpr auto fmt::v7::detail::compile_format_string(S) [with Args = fmt::v7::detail::type_list<int, std::chrono::duration<double, std::ratio<1, 1000> > >; long unsigned int POS = 3; int ID = -1; S = compile_test_manual_ordering_Test::TestBody()::<lambda()>::FMT_COMPILE_STRING]’
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h:356:63:   required from ‘constexpr auto fmt::v7::detail::parse_tail(T, S) [with Args = fmt::v7::detail::type_list<int, std::chrono::duration<double, std::ratio<1, 1000> > >; long unsigned int POS = 3; int ID = -1; T = fmt::v7::detail::field<char, int, 0>; S = compile_test_manual_ordering_Test::TestBody()::<lambda()>::FMT_COMPILE_STRING]’
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h:433:50:   required from ‘constexpr auto fmt::v7::detail::parse_replacement_field_then_tail(S) [with T = int; Args = fmt::v7::detail::type_list<int, std::chrono::duration<double, std::ratio<1, 1000> > >; long unsigned int END_POS = 2; int ARG_INDEX = 0; int NEXT_ID = -1; S = compile_test_manual_ordering_Test::TestBody()::<lambda()>::FMT_COMPILE_STRING]’
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h:479:80:   required from ‘constexpr auto fmt::v7::detail::compile_format_string(S) [with Args = fmt::v7::detail::type_list<int, std::chrono::duration<double, std::ratio<1, 1000> > >; long unsigned int POS = 0; int ID = 0; S = compile_test_manual_ordering_Test::TestBody()::<lambda()>::FMT_COMPILE_STRING]’
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h:525:72:   required from ‘constexpr auto fmt::v7::detail::compile(S) [with Args = {int, std::chrono::duration<double, std::ratio<1, 1000> >}; S = compile_test_manual_ordering_Test::TestBody()::<lambda()>::FMT_COMPILE_STRING; typename std::enable_if<fmt::v7::detail::is_compiled_string<S>::value, int>::type <anonymous> = 0]’
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h:570:53:   required from ‘std::__cxx11::basic_string<typename S::char_type> fmt::v7::format(const S&, Args&& ...) [with S = compile_test_manual_ordering_Test::TestBody()::<lambda()>::FMT_COMPILE_STRING; Args = {int, std::chrono::duration<double, std::ratio<1, 1000> >}; typename std::enable_if<fmt::v7::detail::is_compiled_string<S>::value, int>::type <anonymous> = 0; typename S::char_type = char; typename Context::char_type = char]’
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/test/compile-test.cc:129:3:   required from here
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h:356:20: error: ‘constexpr const void tail’ has incomplete type
     constexpr auto tail = compile_format_string<Args, POS, ID>(format_str);
                    ^~~~
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h:359:14: error: unable to deduce ‘auto’ from ‘tail’
       return tail;
              ^~~~
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h: In instantiation of ‘constexpr auto fmt::v7::detail::parse_tail(T, S) [with Args = fmt::v7::detail::type_list<int, std::chrono::duration<double, std::ratio<1, 1000> > >; long unsigned int POS = 3; int ID = -1; T = fmt::v7::detail::field<char, int, 0>; S = compile_test_manual_ordering_Test::TestBody()::<lambda()>::FMT_COMPILE_STRING]’:
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h:433:50:   required from ‘constexpr auto fmt::v7::detail::parse_replacement_field_then_tail(S) [with T = int; Args = fmt::v7::detail::type_list<int, std::chrono::duration<double, std::ratio<1, 1000> > >; long unsigned int END_POS = 2; int ARG_INDEX = 0; int NEXT_ID = -1; S = compile_test_manual_ordering_Test::TestBody()::<lambda()>::FMT_COMPILE_STRING]’
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h:479:80:   required from ‘constexpr auto fmt::v7::detail::compile_format_string(S) [with Args = fmt::v7::detail::type_list<int, std::chrono::duration<double, std::ratio<1, 1000> > >; long unsigned int POS = 0; int ID = 0; S = compile_test_manual_ordering_Test::TestBody()::<lambda()>::FMT_COMPILE_STRING]’
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h:525:72:   required from ‘constexpr auto fmt::v7::detail::compile(S) [with Args = {int, std::chrono::duration<double, std::ratio<1, 1000> >}; S = compile_test_manual_ordering_Test::TestBody()::<lambda()>::FMT_COMPILE_STRING; typename std::enable_if<fmt::v7::detail::is_compiled_string<S>::value, int>::type <anonymous> = 0]’
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h:570:53:   required from ‘std::__cxx11::basic_string<typename S::char_type> fmt::v7::format(const S&, Args&& ...) [with S = compile_test_manual_ordering_Test::TestBody()::<lambda()>::FMT_COMPILE_STRING; Args = {int, std::chrono::duration<double, std::ratio<1, 1000> >}; typename std::enable_if<fmt::v7::detail::is_compiled_string<S>::value, int>::type <anonymous> = 0; typename S::char_type = char; typename Context::char_type = char]’
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/test/compile-test.cc:129:3:   required from here
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h:356:20: error: ‘constexpr const void tail’ has incomplete type
     constexpr auto tail = compile_format_string<Args, POS, ID>(format_str);
                    ^~~~
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h:359:14: error: unable to deduce ‘auto’ from ‘tail’
       return tail;
              ^~~~
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h: In instantiation of ‘constexpr auto fmt::v7::detail::compile(S) [with Args = {int, std::chrono::duration<double, std::ratio<1, 1000> >}; S = compile_test_manual_ordering_Test::TestBody()::<lambda()>::FMT_COMPILE_STRING; typename std::enable_if<fmt::v7::detail::is_compiled_string<S>::value, int>::type <anonymous> = 0]’:
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h:570:53:   required from ‘std::__cxx11::basic_string<typename S::char_type> fmt::v7::format(const S&, Args&& ...) [with S = compile_test_manual_ordering_Test::TestBody()::<lambda()>::FMT_COMPILE_STRING; Args = {int, std::chrono::duration<double, std::ratio<1, 1000> >}; typename std::enable_if<fmt::v7::detail::is_compiled_string<S>::value, int>::type <anonymous> = 0; typename S::char_type = char; typename Context::char_type = char]’
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/test/compile-test.cc:129:3:   required from here
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h:524:20: error: ‘constexpr const void result’ has incomplete type
     constexpr auto result =
                    ^~~~~~
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h:527:12: error: unable to deduce ‘auto’ from ‘result’
     return result;
            ^~~~~~
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h: In instantiation of ‘std::__cxx11::basic_string<typename S::char_type> fmt::v7::format(const S&, Args&& ...) [with S = compile_test_manual_ordering_Test::TestBody()::<lambda()>::FMT_COMPILE_STRING; Args = {int, std::chrono::duration<double, std::ratio<1, 1000> >}; typename std::enable_if<fmt::v7::detail::is_compiled_string<S>::value, int>::type <anonymous> = 0; typename S::char_type = char; typename Context::char_type = char]’:
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/test/compile-test.cc:129:3:   required from here
/home/phprus/devel/fmtlib/test/fmt-3c8fad126ced5e537014d4c50bb3617ee41c6373/include/fmt/compile.h:570:18: error: ‘constexpr const void compiled’ has incomplete type
   constexpr auto compiled = detail::compile<Args...>(S());
                  ^~~~~~~~
make[2]: *** [test/CMakeFiles/compile-test.dir/build.make:83: test/CMakeFiles/compile-test.dir/compile-test.cc.o] Ошибка 1
@phprus
Copy link
Contributor Author

phprus commented Jun 14, 2021

Error is presented on:

  • gcc version 7.5.0 (SUSE Linux)
  • gcc version 8.2.1 20180831 [gcc-8-branch revision 264010] (SUSE Linux)

with enabled c++17.

@phprus
Copy link
Contributor Author

phprus commented Jun 14, 2021

Workaround:
Move 3c8fad1#diff-f5b9e34d142700358618faa7363cd41bc5662525a82c49f7e6e9dfa2ec8bfc93R2123-R2124 to else branch:

else {
  eh.on_error("number is too big");
  return -1;
}

phprus added a commit to phprus/fmt that referenced this issue Jun 14, 2021
@phprus phprus mentioned this issue Jun 14, 2021
@vitaut
Copy link
Contributor

vitaut commented Jun 14, 2021

I think e421d52 should fix the error.

@phprus
Copy link
Contributor Author

phprus commented Jun 15, 2021

Yes, this commit fixed the bug.

@vitaut
Copy link
Contributor

vitaut commented Jun 15, 2021

Thanks for checking.

@vitaut vitaut closed this as completed Jun 15, 2021
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