Add return type checking for overriding virtual functions. We currently don't check covariance but that's next.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71759 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/virtual-override.cpp b/test/SemaCXX/virtual-override.cpp
new file mode 100644
index 0000000..c1b95cc
--- /dev/null
+++ b/test/SemaCXX/virtual-override.cpp
@@ -0,0 +1,13 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+namespace T1 {
+
+class A {
+ virtual int f(); // expected-note{{overridden virtual function is here}}
+};
+
+class B : A {
+ virtual void f(); // expected-error{{virtual function 'f' has a different return type ('void') than the function it overrides (which has return type 'int')}}
+};
+
+}