summaryrefslogtreecommitdiffstats
path: root/Source/Checks/cm_cxx_override.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Checks/cm_cxx_override.cxx')
-rw-r--r--Source/Checks/cm_cxx_override.cxx20
1 files changed, 20 insertions, 0 deletions
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);
+}