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

Honest advertising on supported language versions #378

Closed
MathiasMagnus opened this issue Aug 11, 2020 · 0 comments
Closed

Honest advertising on supported language versions #378

MathiasMagnus opened this issue Aug 11, 2020 · 0 comments

Comments

@MathiasMagnus
Copy link

Expected Behavior

If C++17* support (*with limitations) is advertised, things should mostly work when in C++17 mode.

Actual Behavior

Even

int main() {
  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...>)'

This issue is not unique to MSVC, even Appveyor build with clang-cl have output such as:

[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
    >
)
  1. 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

  • Version: 1.1.5+
  • Platform: Windows
  • Subsystem: ?
kris-jusiak added a commit to kris-jusiak/ut that referenced this issue Aug 12, 2020
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.
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

1 participant