CMake/Tests/CompileFeatures/genex_test.cpp
Robert Maynard f73718c9b8 Features: Enable writing of MSVC compiler feature header.
Notes:
VS2015 and above are the only MSVC versions to support cxx_final, so remove
usages from the tests, and instead only test for cxx_override.

VS2012 and above to conform to cxx_decltype_incomplete_return_types
proposal, but without support for auto return types the dcl.type.simple
example in the proposal doesn't compile.

VS2013 and above to conform to the updated cxx_contextual_conversions proposal,
but VS2010 and above pass the test.

Compilers such as MSVC have no explicit flags to enable C++11 mode,
it just is always on. So only run the link tests with compilers that require
a flag to specify the language version.
2015-01-11 11:32:36 -05:00

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