mirror of
https://github.com/Kitware/CMake.git
synced 2025-07-03 02:26:24 +08:00

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.
24 lines
247 B
C++
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()
|
|
{
|
|
|
|
}
|