When checking for weak vtables, check whether the actual definition of
the key function is inline, rather than the original
declaration. Perhaps FunctionDecl::isInlined() is poorly named. Fixes
<rdar://problem/9979458>. 


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140400 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/warn-weak-vtables.cpp b/test/SemaCXX/warn-weak-vtables.cpp
index c0cfd74..912622f 100644
--- a/test/SemaCXX/warn-weak-vtables.cpp
+++ b/test/SemaCXX/warn-weak-vtables.cpp
@@ -29,3 +29,30 @@
   b.f();
   c.f();
 }
+
+// <rdar://problem/9979458>
+class Parent {
+public:
+  Parent() {}
+  virtual ~Parent();
+  virtual void * getFoo() const = 0;    
+};
+  
+class Derived : public Parent {
+public:
+  Derived();
+  void * getFoo() const;
+};
+
+class VeryDerived : public Derived { // expected-warning{{'VeryDerived' has no out-of-line virtual method definitions; its vtable will be emitted in every translation unit}}
+public:
+  void * getFoo() const { return 0; }
+};
+
+Parent::~Parent() {}
+
+void uses(Parent &p, Derived &d, VeryDerived &vd) {
+  p.getFoo();
+  d.getFoo();
+  vd.getFoo();
+}