std::is_literal_type was deprecated in C++17 and removed in C++20. Section [diff.cpp17.depr]/7 of the C++20 Working Draft explains:
The traits had unreliable or awkward interfaces. The is_literal_type trait provided no way to detect which subset of constructors and member functions of a type were declared constexpr.
In /std:c++17 mode, this triggers a deprecation warning in recent versions of MSVC. In /std:c++latest mode, now that https://github.com/microsoft/STL/pull/380 has been merged, this will trigger an error in VS 2019 16.6 Preview 2.
MSVC provides "escape hatch" macros that can be defined project-wide to suppress the deprecation warning and restore the removed type trait. (Specifically, compiling with /D_SILENCE_CXX17_IS_LITERAL_TYPE_DEPRECATION_WARNING and /D_HAS_DEPRECATED_IS_LITERAL_TYPE=1.) However, it's best to avoid using this deprecated/removed machinery entirely.
After looking at your code briefly, you appear to be testing the constexpr-ness of result and outcome, with several tests for construction, member functions, and destruction. If that's comprehensive, you may simply be able to remove the static_assert(std::is_literal_type lines entirely (or guard them for C++17/20+ mode).
std::is_literal_type
was deprecated in C++17 and removed in C++20. Section [diff.cpp17.depr]/7 of the C++20 Working Draft explains:This trait is being directly used here:
https://github.com/ned14/outcome/blob/627f7842d55ae80239e1a17d521bc14183653d9d/test/tests/constexpr.cpp#L31-L32
In
/std:c++17
mode, this triggers a deprecation warning in recent versions of MSVC. In/std:c++latest
mode, now that https://github.com/microsoft/STL/pull/380 has been merged, this will trigger an error in VS 2019 16.6 Preview 2.MSVC provides "escape hatch" macros that can be defined project-wide to suppress the deprecation warning and restore the removed type trait. (Specifically, compiling with
/D_SILENCE_CXX17_IS_LITERAL_TYPE_DEPRECATION_WARNING
and/D_HAS_DEPRECATED_IS_LITERAL_TYPE=1
.) However, it's best to avoid using this deprecated/removed machinery entirely.After looking at your code briefly, you appear to be testing the
constexpr
-ness ofresult
andoutcome
, with several tests for construction, member functions, and destruction. If that's comprehensive, you may simply be able to remove thestatic_assert(std::is_literal_type
lines entirely (or guard them for C++17/20+ mode).