1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-07-03 02:26:24 +08:00
CMake/Tests/CompileFeatures/genex_test.cpp
Stephen Kelly b3e86f4e97 Features: Test an expectation of whether OVERRIDE_CONTROL is expected
The tests below test the presence of both cxx_final and cxx_override,
only one of which is supported by MSVC.  The test is in part intended
to verify that the COMPILE_FEATURES genex supports multiple arguments
and allows users to define names for groups of features (Clang already
calls cxx_final and cxx_override 'override control' as a group).  Keep
the test, and allow the expectation to be set as appropriate.
2015-01-03 15:09:58 +01:00

24 lines
247 B
C++

#if !HAVE_OVERRIDE_CONTROL
#if EXPECT_OVERRIDE_CONTROL
#error "Expect override control feature"
#endif
#else
struct A
{
virtual int getA() { return 7; }
};
struct B final : A
{
int getA() override { return 42; }
};
#endif
int main()
{
}