CMake/Tests/CompileFeatures/genex_test.cpp
Stephen Kelly c13656e717 Features: Test nullptr as a side-effect activation of static_assert.
Because not all compilers under test support the existing 'activation
features', add another test to ensure that compilers which support
both static_assert and nullptr behave as expected in this test.
2015-01-03 15:14:52 +01:00

35 lines
359 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
#if !HAVE_NULLPTR
#error "Expect nullptr feature"
#else
const char* getString()
{
return nullptr;
}
#endif
int main()
{
}