You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If C++17* support (*with limitations) is advertised, things should mostly work when in C++17 mode.
Actual Behavior
Even
intmain() {
boost::ut::expect(true);
}
fails to compile with MSVC saying:
[build] C:\Users\mnagy\Source\Repos\ut\.vscode\install\include\boost/ut.hpp(1402): error C7555: use of designated initializers requires at least '/std:c++latest'
[build] C:\Users\mnagy\Source\Repos\ut\.vscode\install\include\boost/ut.hpp(1402): note: This diagnostic occurred in the compiler generated function 'auto boost::ext::ut::v1_1_8::runner<TReporter,MaxPathSize>::on(boost::ext::ut::v1_1_8::events::test<Ts...>)'
[57/112] Building CXX object example\CMakeFiles\boost_ut_parameterized.dir\parameterized.cpp.obj
..\example\parameterized.cpp(30,20): warning: explicit template parameter list for lambdas is a C++20 extension [-Wc++20-extensions]
"types"_test = []<class T>() {
^
When the entry points to testing use C++20 features, I naturally don't expect Boost UT to work in C++17 mode, but most features should have C++17 workarounds (hence the asterisk "with limitations").
Either decide whether the library supports C++17 or not. If yes, actually specify/mark which features are known to not work. Run strict C++17 builds in CI (-Werror) and disable such tests on purpose if there are no workarounds implemented.
BTW, this regression was introduced in v1.1.5, as installing tagged version of v1.1.4 compiles the simplest example as intended.
Steps to Reproduce the Problem
cmake_minimum_required(VERSION 3.0)
project(Test-Boost.UT
LANGUAGES CXX
)
if (MSVC)
string(REGEX REPLACE "/W[0-9]" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
endif (MSVC)
find_package(ut REQUIRED)
add_executable(Test1 Test1.cpp)
target_link_libraries(Test1
PRIVATE
boost::ut
)
target_compile_options(Test1
PRIVATE
$<$<CXX_COMPILER_ID:MSVC>:
/W4 # Turn on all (sensible) warnings
/permissive- # Turn on strict language conformance
/EHsc # Specify exception handling model
>
)
Problem:
- C++17 support is advertised but it only works with Clang/GCC and not MSVC.
Solution:
- Remove mention of C++17 support as it's limited and not fully supported and/or maintained.
Expected Behavior
If C++17* support (*with limitations) is advertised, things should mostly work when in C++17 mode.
Actual Behavior
Even
fails to compile with MSVC saying:
This issue is not unique to MSVC, even Appveyor build with clang-cl have output such as:
When the entry points to testing use C++20 features, I naturally don't expect Boost UT to work in C++17 mode, but most features should have C++17 workarounds (hence the asterisk "with limitations").
Either decide whether the library supports C++17 or not. If yes, actually specify/mark which features are known to not work. Run strict C++17 builds in CI (
-Werror
) and disable such tests on purpose if there are no workarounds implemented.BTW, this regression was introduced in
v1.1.5
, as installing tagged version ofv1.1.4
compiles the simplest example as intended.Steps to Reproduce the Problem
C:\Kellekek\Microsoft\VisualStudio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\bin\Hostx64\x64\cl.exe /nologo /TP -IC:\Users\mnagy\Source\Repos\ut\.vscode\install\include /DWIN32 /D_WINDOWS /GR /EHsc /MDd /Zi /Ob0 /Od /RTC1 /W4 /permissive- /EHsc /std:c++17 /showIncludes /FoCMakeFiles\Test1.dir\Test1.cpp.obj /FdCMakeFiles\Test1.dir\ /FS -c ..\..\Test1.cpp
Specifications
The text was updated successfully, but these errors were encountered: