Skip to content

MSVC C++17 build errors #2328

Description

@phprus

Commit: 19d45f4

MSVC 19.16.27045.0 + C++17:

D:\a\fmt\fmt\include\fmt/compile.h(519): error C2131: expression did not evaluate to a constant [D:\a\fmt\build\test\compile-test.vcxproj]

https://github.com/phprus/fmt/runs/2704761925?check_suite_focus=true#step:5:46

and (cmake -DCMAKE_VERBOSE_MAKEFILE=1 -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_CXX_STANDARD=17 -G "NMake Makefiles" ..\..):

Scanning dependencies of target compile-test
        "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\
MSVC\14.16.27023\bin\HostX86\x86\nmake.exe" -f test\CMakeFiles\compile-test.dir\
build.make /nologo -L                  test\CMakeFiles\compile-test.dir\build
[ 32%] Building CXX object test/CMakeFiles/compile-test.dir/compile-test.cc.obj
        cd F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\build\17\test

        C:\PROGRA~2\MICROS~1\2017\COMMUN~1\VC\Tools\MSVC\1416~1.270\bin\Hostx86\
x86\cl.exe @C:\Users\phprus\AppData\Local\Temp\nm4B84.tmp
Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27045 for x86
Copyright (C) Microsoft Corporation.  All rights reserved.

cl   /TP -DFMT_LOCALE -DGTEST_HAS_STD_WSTRING=1 -D_SILENCE_TR1_NAMESPACE_DEPRECA
TION_WARNING=1 -IF:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include
 -IF:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\test\gtest\. /DWIN32
/D_WINDOWS /GR /EHsc /O2 /Ob2 /DNDEBUG -MD   -std:c++17 /FoCMakeFiles\compile-te
st.dir\compile-test.cc.obj /FdCMakeFiles\compile-test.dir\ /FS -c F:\tmp\fmt\fmt
-19d45f4b312e587da201c05c5b4748740c65f3e8\test\compile-test.cc

compile-test.cc
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt/chrono.h(301
): warning C4305: 'specialization': truncation from 'int' to 'bool'
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt/compile.h(51
9): error C2131: expression did not evaluate to a constant
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt/compile.h(51
9): note: failure was caused by call of undefined function or one not declared '
constexpr'
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt/compile.h(51
9): note: see usage of 'compile_test_named_Test::TestBody::<lambda_8d7daa2132c7b
b38b2944b3c7aa05a56>::()::FMT_COMPILE_STRING::operator fmt::v7::basic_string_vie
w<char>'
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\test\compile-test.cc(129
): note: see reference to function template instantiation 'auto fmt::v7::detail:
:compile<fmt::v7::detail::named_arg<char,int>,compile_test_named_Test::TestBody:
:<lambda_8d7daa2132c7bb38b2944b3c7aa05a56>::()::FMT_COMPILE_STRING,0>(S)' being
compiled
        with
        [
            S=compile_test_named_Test::TestBody::<lambda_8d7daa2132c7bb38b2944b3
c7aa05a56>::()::FMT_COMPILE_STRING
        ]
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt/compile.h(52
0): error C2131: expression did not evaluate to a constant
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt/compile.h(51
9): note: failure was caused by call of undefined function or one not declared '
constexpr'
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt/compile.h(51
9): note: see usage of 'compile_test_named_Test::TestBody::<lambda_8d7daa2132c7b
b38b2944b3c7aa05a56>::()::FMT_COMPILE_STRING::operator fmt::v7::basic_string_vie
w<char>'
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt/compile.h(45
0): error C2131: expression did not evaluate to a constant
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt/compile.h(45
0): note: failure was caused by call of undefined function or one not declared '
constexpr'
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt/compile.h(45
0): note: see usage of 'compile_test_named_Test::TestBody::<lambda_8d7daa2132c7b
b38b2944b3c7aa05a56>::()::FMT_COMPILE_STRING::operator fmt::v7::basic_string_vie
w<char>'
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt/compile.h(51
8): note: see reference to function template instantiation 'auto fmt::v7::detail
::compile_format_string<fmt::v7::detail::type_list<fmt::v7::detail::named_arg<ch
ar,int>>,0,0,S>(S)' being compiled
        with
        [
            S=compile_test_named_Test::TestBody::<lambda_8d7daa2132c7bb38b2944b3
c7aa05a56>::()::FMT_COMPILE_STRING
        ]
f:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt\format.h(546
): note: see reference to class template instantiation 'fmt::v7::basic_string_vi
ew<char>' being compiled
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt/compile.h(45
1): error C2131: expression did not evaluate to a constant
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt/compile.h(45
0): note: failure was caused by call of undefined function or one not declared '
constexpr'
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt/compile.h(45
0): note: see usage of 'compile_test_named_Test::TestBody::<lambda_8d7daa2132c7b
b38b2944b3c7aa05a56>::()::FMT_COMPILE_STRING::operator fmt::v7::basic_string_vie
w<char>'
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt/compile.h(45
2): error C2131: expression did not evaluate to a constant
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt/compile.h(45
0): note: failure was caused by call of undefined function or one not declared '
constexpr'
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt/compile.h(45
0): note: see usage of 'compile_test_named_Test::TestBody::<lambda_8d7daa2132c7b
b38b2944b3c7aa05a56>::()::FMT_COMPILE_STRING::operator fmt::v7::basic_string_vie
w<char>'
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt/compile.h(45
4): error C2131: expression did not evaluate to a constant
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt/compile.h(45
0): note: failure was caused by call of undefined function or one not declared '
constexpr'
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt/compile.h(45
0): note: see usage of 'compile_test_named_Test::TestBody::<lambda_8d7daa2132c7b
b38b2944b3c7aa05a56>::()::FMT_COMPILE_STRING::operator fmt::v7::basic_string_vie
w<char>'
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt/compile.h(35
3): error C2131: expression did not evaluate to a constant
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt/compile.h(35
4): note: failure was caused by call of undefined function or one not declared '
constexpr'
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt/compile.h(35
4): note: see usage of 'compile_test_named_Test::TestBody::<lambda_8d7daa2132c7b
b38b2944b3c7aa05a56>::()::FMT_COMPILE_STRING::operator fmt::v7::basic_string_vie
w<char>'
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt/compile.h(51
3): note: see reference to function template instantiation 'auto fmt::v7::detail
::parse_tail<Args,2,0,fmt::v7::detail::text<char>,S>(T,S)' being compiled
        with
        [
            Args=fmt::v7::detail::type_list<fmt::v7::detail::named_arg<char,int>
>,
            S=compile_test_named_Test::TestBody::<lambda_8d7daa2132c7bb38b2944b3
c7aa05a56>::()::FMT_COMPILE_STRING,
            T=fmt::v7::detail::text<char>
        ]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.1
6.27023\include\xstring(481): fatal error C1202: recursive type or function depe
ndency context too complex
NMAKE : fatal error U1077: 'C:\PROGRA~2\MICROS~1\2017\COMMUN~1\VC\Tools\MSVC\141
6~1.270\bin\Hostx86\x86\cl.exe' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017
\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\nmake.exe"' : return code '
0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017
\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\nmake.exe"' : return code '
0x2'
Stop.

F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\build\17>

MSVC 19.20.27519.0 + C++17 (cmake -DCMAKE_VERBOSE_MAKEFILE=1 -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_CXX_STANDARD=17 -G "NMake Makefiles" ..\..):

[  1%] Building CXX object CMakeFiles/fmt.dir/src/format.cc.obj
        C:\PROGRA~2\MICROS~1\2019\COMMUN~1\VC\Tools\MSVC\1420~1.275\bin\HostX86\x86\cl.exe @C:\Users
\phprus\AppData\Local\Temp\nmE960.tmp
Microsoft (R) C/C++ Optimizing Compiler Version 19.20.27519 for x86
Copyright (C) Microsoft Corporation.  All rights reserved.

cl   /TP -DFMT_LOCALE -IF:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include /DWIN32 /D_W
INDOWS /GR /EHsc /O2 /Ob2 /DNDEBUG -MD   -std:c++17 /FoCMakeFiles\fmt.dir\src\format.cc.obj /FdCMake
Files\fmt.dir\fmt.pdb /FS -c F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\src\format.cc

format.cc
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt\core.h(2180): error C3615: const
expr function 'fmt::v7::detail::parse_width::width_adapter::on_error' cannot result in a constant ex
pression
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt\core.h(2181): note: failure was
caused by call of undefined function or one not declared 'constexpr'
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt\core.h(2181): note: see usage of
 'fmt::v7::detail::specs_handler<Char>::on_error'
        with
        [
            Char=char
        ]
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt\core.h(2279): note: see referenc
e to function template instantiation 'const Char *fmt::v7::detail::parse_width<Char,fmt::v7::detail:
:specs_checker<fmt::v7::detail::specs_handler<Char>>&>(const Char *,const Char *,Handler)' being com
piled
        with
        [
            Char=char,
            Handler=fmt::v7::detail::specs_checker<fmt::v7::detail::specs_handler<char>> &
        ]
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt\format.h(2690): note: see refere
nce to function template instantiation 'const Char *fmt::v7::detail::parse_format_specs<Char,fmt::v7
::detail::specs_checker<fmt::v7::detail::specs_handler<Char>>&>(const Char *,const Char *,SpecHandle
r)' being compiled
        with
        [
            Char=char,
            SpecHandler=fmt::v7::detail::specs_checker<fmt::v7::detail::specs_handler<char>> &
        ]
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt/format-inl.h(2570): note: see re
ference to function template instantiation 'void fmt::v7::detail::vformat_to<char>(fmt::v7::detail::
buffer<char> &,fmt::v7::string_view,fmt::v7::basic_format_args<fmt::v7::format_context>,fmt::v7::det
ail::locale_ref)' being compiled
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt\core.h(2209): error C3615: const
expr function 'fmt::v7::detail::parse_precision::precision_adapter::on_error' cannot result in a con
stant expression
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt\core.h(2210): note: failure was
caused by call of undefined function or one not declared 'constexpr'
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt\core.h(2210): note: see usage of
 'fmt::v7::detail::specs_handler<Char>::on_error'
        with
        [
            Char=char
        ]
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt\core.h(2284): note: see referenc
e to function template instantiation 'const Char *fmt::v7::detail::parse_precision<Char,fmt::v7::det
ail::specs_checker<fmt::v7::detail::specs_handler<Char>>&>(const Char *,const Char *,Handler)' being
 compiled
        with
        [
            Char=char,
            Handler=fmt::v7::detail::specs_checker<fmt::v7::detail::specs_handler<char>> &
        ]
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt\core.h(2305): error C3615: const
expr function 'fmt::v7::detail::parse_replacement_field::id_adapter::operator ()' cannot result in a
 constant expression
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt\core.h(2305): note: failure was
caused by call of undefined function or one not declared 'constexpr'
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt\core.h(2305): note: see usage of
 'fmt::v7::detail::vformat_to::format_handler::on_arg_id'
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt\core.h(2353): note: see referenc
e to function template instantiation 'const Char *fmt::v7::detail::parse_replacement_field<Char,Hand
ler&>(const Char *,const Char *,fmt::v7::detail::vformat_to::format_handler&)' being compiled
        with
        [
            Char=char,
            Handler=fmt::v7::detail::vformat_to::format_handler
        ]
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt\format.h(2699): note: see refere
nce to function template instantiation 'void fmt::v7::detail::parse_format_string<false,char,fmt::v7
::detail::vformat_to::format_handler>(fmt::v7::basic_string_view<char>,Handler &&)' being compiled
        with
        [
            Handler=fmt::v7::detail::vformat_to::format_handler
        ]
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt\core.h(2306): error C3615: const
expr function 'fmt::v7::detail::parse_replacement_field::id_adapter::operator ()' cannot result in a
 constant expression
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt\core.h(2306): note: failure was
caused by call of undefined function or one not declared 'constexpr'
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt\core.h(2306): note: see usage of
 'fmt::v7::detail::vformat_to::format_handler::on_arg_id'
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt\core.h(2307): error C3615: const
expr function 'fmt::v7::detail::parse_replacement_field::id_adapter::operator ()' cannot result in a
 constant expression
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt\core.h(2308): note: failure was
caused by call of undefined function or one not declared 'constexpr'
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt\core.h(2308): note: see usage of
 'fmt::v7::detail::vformat_to::format_handler::on_arg_id'
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt\core.h(2310): error C3615: const
expr function 'fmt::v7::detail::parse_replacement_field::id_adapter::on_error' cannot result in a co
nstant expression
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt\core.h(2311): note: failure was
caused by call of undefined function or one not declared 'constexpr'
F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\include\fmt\core.h(2311): note: see usage of
 'fmt::v7::detail::error_handler::on_error'
NMAKE : fatal error U1077: 'C:\PROGRA~2\MICROS~1\2019\COMMUN~1\VC\Tools\MSVC\1420~1.275\bin\HostX86\
x86\cl.exe' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\
MSVC\14.20.27508\bin\HostX86\x86\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\
MSVC\14.20.27508\bin\HostX86\x86\nmake.exe"' : return code '0x2'
Stop.

F:\tmp\fmt\fmt-19d45f4b312e587da201c05c5b4748740c65f3e8\build\19>

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