diff options
author | dim <dim@FreeBSD.org> | 2015-01-18 16:23:48 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-01-18 16:23:48 +0000 |
commit | c86b984ea8ecb3e944dc3de48539f4c1f65851ea (patch) | |
tree | 3eb853da77d46cc77c4b017525a422f9ddb1385b /test/SemaTemplate/virtual-member-functions.cpp | |
parent | c696171ff15f0ee60dea4abfd99a135473c95656 (diff) | |
download | FreeBSD-src-c86b984ea8ecb3e944dc3de48539f4c1f65851ea.zip FreeBSD-src-c86b984ea8ecb3e944dc3de48539f4c1f65851ea.tar.gz |
Vendor import of clang RELEASE_360/rc1 tag r226102 (effectively, 3.6.0 RC1):
https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_360/rc1@226102
Diffstat (limited to 'test/SemaTemplate/virtual-member-functions.cpp')
-rw-r--r-- | test/SemaTemplate/virtual-member-functions.cpp | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/test/SemaTemplate/virtual-member-functions.cpp b/test/SemaTemplate/virtual-member-functions.cpp index a23bf4e..c2fc263 100644 --- a/test/SemaTemplate/virtual-member-functions.cpp +++ b/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> @@ -27,6 +25,24 @@ template<> void X<int>::f() { } } +// Like PR5557, but with a defined destructor instead of a defined constructor. +namespace PR5557_dtor { +template <class T> struct A { + A(); // Don't have an implicit constructor. + ~A(); // expected-note{{instantiation}} + 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}} +} + +void f() { + A<int> x; // expected-note{{instantiation}} +} +} + template<typename T> struct Base { virtual ~Base() { |