From d0798a5e0d3828b491ed35b2f62edf6aef199e2b Mon Sep 17 00:00:00 2001 From: Alex AUVOLAT Date: Thu, 9 Jan 2014 11:49:54 +0100 Subject: Reject redefinition of virtual methods with different return type. --- tests/typing/bad/testfile-invalid-virtual-redef.cpp | 11 +++++++++++ tests/typing/good/testfile-return-type-redef.cpp | 11 +++++++++++ 2 files changed, 22 insertions(+) create mode 100644 tests/typing/bad/testfile-invalid-virtual-redef.cpp create mode 100644 tests/typing/good/testfile-return-type-redef.cpp (limited to 'tests/typing') diff --git a/tests/typing/bad/testfile-invalid-virtual-redef.cpp b/tests/typing/bad/testfile-invalid-virtual-redef.cpp new file mode 100644 index 0000000..263ec62 --- /dev/null +++ b/tests/typing/bad/testfile-invalid-virtual-redef.cpp @@ -0,0 +1,11 @@ +class A { + public: + virtual int f(int x); +}; + +class B : public A { + public: + virtual void f(int x); +}; + +int main() {} diff --git a/tests/typing/good/testfile-return-type-redef.cpp b/tests/typing/good/testfile-return-type-redef.cpp new file mode 100644 index 0000000..ff14d00 --- /dev/null +++ b/tests/typing/good/testfile-return-type-redef.cpp @@ -0,0 +1,11 @@ +class A { + public: + int f(int x); +}; + +class B : public A { + public: + void f(int x); +}; + +int main() {} -- cgit v1.2.3