summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/virtual-member-functions.cpp
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2015-01-13 00:24:46 +0000
committerNico Weber <nicolasweber@gmx.de>2015-01-13 00:24:46 +0000
commitc4b8e79396014a41527dfc3ecc1c1a16ba2f946f (patch)
tree0b462d0639cd124e219493c647436947d32fb9d3 /clang/test/SemaTemplate/virtual-member-functions.cpp
parentacf25766ad48266a82d6dec1f7ffd36728b4f8b5 (diff)
downloadbcm5719-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.cpp8
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>
OpenPOWER on IntegriCloud