On OpenBSD linking to `libstdc++` with GCC 6.4 always warns:
warning: sprintf() is often misused, please use snprintf()
These do not affect the availability of C++ features we're checking,
so filter them out.
Fixes: #18602
In some environments the linker produces warnings like
warning: directory not found for option
warning: object file compiled with -mlong-branch ...
These do not affect the availability of C++ features we're checking,
so filter them out.
Fixes: #17850, #17947
Use the macro now provided by KWSys instead of using `try_compile`
checks. It will no longer consider the `__attribute__((fallthrough))`
variant, but compilers that don't have one of the modern attributes
shouldn't warn about not using one anyway.
Filter out `-Winvalid-command-line-argument` warnings from Clang (that
can be caused by user-specified flags) so that they do not break our
checks for C++ feature availability.
Simply matching "0 Warning" may match "10 Warning(s)". Instead remove
the entire ` 0 Warning(s)` content from the MSBuild output before
searching it for warnings.
Issue: #16942
The change in commit v3.9.0-rc1~6^2~1 (C++ feature checks: check output
for '[Ww]arning', 2017-06-03) accidentally matches `0 Warning(s)` in the
output and always thinks a warning exists, thus failing all checks in
Visual Studio builds.
Fixes: #16942
When using `CMake_NO_CXX_STANDARD` a user may still provide `-std=c++11`
or similar flags in `CMAKE_CXX_FLAGS`, so we should still check for the
available C++ features.
Turn the feature check for cxx11_unordered_map into a function such that
we can use it for other features as well. Drop the 11 suffix, as we may
want to check features from other standards.