From 109fb0cbaf330ef61516f132de9ca12179df07e5 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Tue, 13 Jan 2015 00:24:46 +0000 Subject: [PATCH] Simplify a test. No behavior change. 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225741 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/SemaTemplate/virtual-member-functions.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/test/SemaTemplate/virtual-member-functions.cpp b/test/SemaTemplate/virtual-member-functions.cpp index a23bf4e3ee..96c661582f 100644 --- a/test/SemaTemplate/virtual-member-functions.cpp +++ b/test/SemaTemplate/virtual-member-functions.cpp @@ -3,19 +3,17 @@ namespace PR5557 { template struct A { - A(); - virtual void anchor(); + A(); // expected-note{{instantiation}} virtual int a(T x); }; template A::A() {} -template void A::anchor() { } template int A::a(T x) { return *x; // expected-error{{requires pointer operand}} } -void f(A x) { - x.anchor(); // expected-note{{instantiation}} +void f() { + A x; // expected-note{{instantiation}} } template -- 2.40.0