Simplify a test. No behavior change.
authorNico Weber <nicolasweber@gmx.de>
Tue, 13 Jan 2015 00:24:46 +0000 (00:24 +0000)
committerNico Weber <nicolasweber@gmx.de>
Tue, 13 Jan 2015 00:24:46 +0000 (00:24 +0000)
Templates don't have key functions (cf computeKeyFunction() in
RecordLayoutBuilder.cpp), so don't have something that looks like one.

Also, instead of a vcall to force generation of the vtable, just construct
the object.  This is how the repro on PR5557 (what the test is for) worked too.

llvm-svn: 225741

clang/test/SemaTemplate/virtual-member-functions.cpp

index a23bf4e..96c6615 100644 (file)
@@ -3,19 +3,17 @@
 
 namespace PR5557 {
 template <class T> struct A {
-  A();
-  virtual void anchor();
+  A(); // expected-note{{instantiation}}
   virtual int a(T x);
 };
 template<class T> A<T>::A() {}
-template<class T> void A<T>::anchor() { }
 
 template<class T> int A<T>::a(T x) { 
   return *x; // expected-error{{requires pointer operand}}
 }
 
-void f(A<int> x) {
-  x.anchor(); // expected-note{{instantiation}}
+void f() {
+  A<int> x; // expected-note{{instantiation}}
 }
 
 template<typename T>