CXXMethodDecl::isVirtual needs to check the canonical declaration. Fixes PR4878.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81715 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/attr-deprecated.cpp b/test/SemaCXX/attr-deprecated.cpp
index c1bdfcc..54f8b5b 100644
--- a/test/SemaCXX/attr-deprecated.cpp
+++ b/test/SemaCXX/attr-deprecated.cpp
@@ -54,3 +54,13 @@
   c->C::f();
   c->B::f(); // expected-warning{{'f' is deprecated}}
 }
+
+struct D {
+  virtual void f() __attribute__((deprecated));
+};
+
+void D::f() { }
+
+void f(D* d) {
+  d->f();
+}