Skip to content

error C3615: constexpr function 'fmt::v8::detail::count_digits' cannot result in a constant expression #2761

Description

@phprus

Cmake & build log:

F:\tmp\fmt\fmt-c48353cb753889c38a94809b5bc72cedc1dedd26\build\2019-32-r>cmake -D
CMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=20 -DC
MAKE_CXX_FLAGS_INIT="/Zc:__cplusplus" -G "NMake Makefiles" ..\..
-- CMake version: 3.20.5
-- The CXX compiler identification is MSVC 19.29.30139.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studi
o/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx86/x86/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Module support is disabled.
-- Version: 8.1.1
-- Build type: Release
-- CXX_STANDARD: 20
-- Performing Test has_std_20_flag
-- Performing Test has_std_20_flag - Failed
-- Performing Test has_std_2a_flag
-- Performing Test has_std_2a_flag - Failed
-- Performing Test SUPPORTS_USER_DEFINED_LITERALS
-- Performing Test SUPPORTS_USER_DEFINED_LITERALS - Success
-- Performing Test FMT_HAS_VARIANT
-- Performing Test FMT_HAS_VARIANT - Success
-- Required features: cxx_variadic_templates
-- Target 'doc' disabled (requires doxygen)
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - not found
-- Found Threads: TRUE
-- Performing Test HAVE_FNO_DELETE_NULL_POINTER_CHECKS
-- Performing Test HAVE_FNO_DELETE_NULL_POINTER_CHECKS - Failed
-- FMT_PEDANTIC: OFF
-- Configuring done
-- Generating done
-- Build files have been written to: F:/tmp/fmt/fmt-c48353cb753889c38a94809b5bc7
2cedc1dedd26/build/2019-32-r

F:\tmp\fmt\fmt-c48353cb753889c38a94809b5bc72cedc1dedd26\build\2019-32-r>




cl   /TP -DGTEST_HAS_STD_WSTRING=1 -D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING=
1 -IF:\tmp\fmt\fmt-c48353cb753889c38a94809b5bc72cedc1dedd26\include -IF:\tmp\fmt
\fmt-c48353cb753889c38a94809b5bc72cedc1dedd26\test\gtest\. /Zc:__cplusplus /DWIN
32 /D_WINDOWS /GR /EHsc /O2 /Ob2 /DNDEBUG -MD -std:c++20 /showIncludes /FoCMakeF
iles\compile-test.dir\compile-test.cc.obj /FdCMakeFiles\compile-test.dir\ /FS -c
 F:\tmp\fmt\fmt-c48353cb753889c38a94809b5bc72cedc1dedd26\test\compile-test.cc

compile-test.cc
F:\tmp\fmt\fmt-c48353cb753889c38a94809b5bc72cedc1dedd26\test\compile-test.cc(333
): error C3615: constexpr function 'fmt::v8::detail::count_digits' cannot result
 in a constant expression
F:\tmp\fmt\fmt-c48353cb753889c38a94809b5bc72cedc1dedd26\include\fmt\format.h(995
): note: failure was caused by call of undefined function or one not declared 'c
onstexpr'
F:\tmp\fmt\fmt-c48353cb753889c38a94809b5bc72cedc1dedd26\include\fmt\format.h(995
): note: see usage of 'fmt::v8::detail::clz'
F:\tmp\fmt\fmt-c48353cb753889c38a94809b5bc72cedc1dedd26\test\compile-test.cc(334
): error C3615: constexpr function 'fmt::v8::detail::count_digits' cannot result
 in a constant expression
F:\tmp\fmt\fmt-c48353cb753889c38a94809b5bc72cedc1dedd26\include\fmt\format.h(995
): note: failure was caused by call of undefined function or one not declared 'c
onstexpr'
F:\tmp\fmt\fmt-c48353cb753889c38a94809b5bc72cedc1dedd26\include\fmt\format.h(995
): note: see usage of 'fmt::v8::detail::clz'
F:\tmp\fmt\fmt-c48353cb753889c38a94809b5bc72cedc1dedd26\test\compile-test.cc(335
): error C3615: constexpr function 'fmt::v8::detail::count_digits' cannot result
 in a constant expression
F:\tmp\fmt\fmt-c48353cb753889c38a94809b5bc72cedc1dedd26\include\fmt\format.h(995
): note: failure was caused by call of undefined function or one not declared 'c
onstexpr'
F:\tmp\fmt\fmt-c48353cb753889c38a94809b5bc72cedc1dedd26\include\fmt\format.h(995
): note: see usage of 'fmt::v8::detail::clz'
F:\tmp\fmt\fmt-c48353cb753889c38a94809b5bc72cedc1dedd26\test\compile-test.cc(336
): error C3615: constexpr function 'fmt::v8::detail::count_digits' cannot result
 in a constant expression
F:\tmp\fmt\fmt-c48353cb753889c38a94809b5bc72cedc1dedd26\include\fmt\format.h(995
): note: failure was caused by call of undefined function or one not declared 'c
onstexpr'
F:\tmp\fmt\fmt-c48353cb753889c38a94809b5bc72cedc1dedd26\include\fmt\format.h(995
): note: see usage of 'fmt::v8::detail::clz'
F:\tmp\fmt\fmt-c48353cb753889c38a94809b5bc72cedc1dedd26\test\compile-test.cc(337
): error C3615: constexpr function 'fmt::v8::detail::count_digits' cannot result
 in a constant expression
F:\tmp\fmt\fmt-c48353cb753889c38a94809b5bc72cedc1dedd26\include\fmt\format.h(995
): note: failure was caused by call of undefined function or one not declared 'c
onstexpr'
F:\tmp\fmt\fmt-c48353cb753889c38a94809b5bc72cedc1dedd26\include\fmt\format.h(995
): note: see usage of 'fmt::v8::detail::clz'
F:\tmp\fmt\fmt-c48353cb753889c38a94809b5bc72cedc1dedd26\test\compile-test.cc(338
): error C3615: constexpr function 'fmt::v8::detail::count_digits' cannot result
 in a constant expression
F:\tmp\fmt\fmt-c48353cb753889c38a94809b5bc72cedc1dedd26\include\fmt\format.h(995
): note: failure was caused by call of undefined function or one not declared 'c
onstexpr'
F:\tmp\fmt\fmt-c48353cb753889c38a94809b5bc72cedc1dedd26\include\fmt\format.h(995
): note: see usage of 'fmt::v8::detail::clz'
NMAKE : fatal error U1077: '"C:\Program Files\CMake\bin\cmake.exe"' : return cod
e '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019
\Community\VC\Tools\MSVC\14.29.30133\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.29.30133\bin\HostX86\x86\nmake.exe"' : return code '
0x2'
Stop.

F:\tmp\fmt\fmt-c48353cb753889c38a94809b5bc72cedc1dedd26\build\2019-32-r>

The error is present only if /Zc:__cplusplus is enabled.

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