Instantiated or specialized class templates never have a key function. This (and the previous check-in) fixes PR5557.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90753 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaTemplate/virtual-member-functions.cpp b/test/SemaTemplate/virtual-member-functions.cpp
new file mode 100644
index 0000000..486c8b2
--- /dev/null
+++ b/test/SemaTemplate/virtual-member-functions.cpp
@@ -0,0 +1,22 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+namespace PR5557 {
+template <class T> struct A {
+  A();
+  virtual int a(T x);
+};
+template<class T> A<T>::A() {}
+template<class T> int A<T>::a(T x) { 
+  return *x; // expected-error{{requires pointer operand}}
+}
+
+A<int> x; // expected-note{{instantiation}}
+
+template<typename T>
+struct X {
+  virtual void f();
+};
+
+template<>
+void X<int>::f() { }
+}