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.cxx24
1 files changed, 24 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..5a33fbb
--- /dev/null
+++ b/Source/Checks/cm_cxx_override.cxx
@@ -0,0 +1,24 @@
+struct Foo
+{
+ Foo() {}
+ virtual ~Foo() {}
+ virtual int test() const = 0;
+};
+
+struct Bar : Foo
+{
+ Bar() {}
+ ~Bar() override {}
+ int test() const override { return 0; }
+};
+
+int test(Foo const& foo)
+{
+ return foo.test();
+}
+
+int main()
+{
+ Bar const bar;
+ return test(bar);
+}