diff options
Diffstat (limited to 'Source/Checks')
-rw-r--r-- | Source/Checks/cm_cxx_features.cmake | 1 | ||||
-rw-r--r-- | Source/Checks/cm_cxx_override.cxx | 20 |
2 files changed, 21 insertions, 0 deletions
diff --git a/Source/Checks/cm_cxx_features.cmake b/Source/Checks/cm_cxx_features.cmake index e550e64..18dbaf8 100644 --- a/Source/Checks/cm_cxx_features.cmake +++ b/Source/Checks/cm_cxx_features.cmake @@ -32,6 +32,7 @@ function(cm_check_cxx_feature name) endfunction() if(CMAKE_CXX_STANDARD) + cm_check_cxx_feature(override) cm_check_cxx_feature(unordered_map) cm_check_cxx_feature(unordered_set) endif() diff --git a/Source/Checks/cm_cxx_override.cxx b/Source/Checks/cm_cxx_override.cxx new file mode 100644 index 0000000..9395a0a --- /dev/null +++ b/Source/Checks/cm_cxx_override.cxx @@ -0,0 +1,20 @@ +struct Foo +{ + virtual int test() const = 0; +}; + +struct Bar : Foo +{ + int test() const override { return 0; } +}; + +int test(Foo const& foo) +{ + return foo.test(); +} + +int main() +{ + Bar const bar; + return test(bar); +} |