diff options
author | Nico Weber <nicolasweber@gmx.de> | 2015-01-13 00:24:46 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2015-01-13 00:24:46 +0000 |
commit | c4b8e79396014a41527dfc3ecc1c1a16ba2f946f (patch) | |
tree | 0b462d0639cd124e219493c647436947d32fb9d3 /clang/test/SemaTemplate/virtual-member-functions.cpp | |
parent | acf25766ad48266a82d6dec1f7ffd36728b4f8b5 (diff) | |
download | bcm5719-llvm-c4b8e79396014a41527dfc3ecc1c1a16ba2f946f.tar.gz bcm5719-llvm-c4b8e79396014a41527dfc3ecc1c1a16ba2f946f.zip |
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.
llvm-svn: 225741
Diffstat (limited to 'clang/test/SemaTemplate/virtual-member-functions.cpp')
-rw-r--r-- | clang/test/SemaTemplate/virtual-member-functions.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/clang/test/SemaTemplate/virtual-member-functions.cpp b/clang/test/SemaTemplate/virtual-member-functions.cpp index a23bf4e3ee5..96c661582f8 100644 --- a/clang/test/SemaTemplate/virtual-member-functions.cpp +++ b/clang/test/SemaTemplate/virtual-member-functions.cpp @@ -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> |