diff options
| author | Roman Divacky <rdivacky@FreeBSD.org> | 2009-10-14 18:03:49 +0000 |
|---|---|---|
| committer | Roman Divacky <rdivacky@FreeBSD.org> | 2009-10-14 18:03:49 +0000 |
| commit | 4c8b24812ddcd1dedaca343a6d4e76f91f398981 (patch) | |
| tree | 137ebebcae16fb0ce7ab4af456992bbd8d22fced /test/SemaTemplate/instantiate-expr-2.cpp | |
| parent | 5362a71c02e7d448a8ce98cf00c47e353fba5d04 (diff) | |
Notes
Diffstat (limited to 'test/SemaTemplate/instantiate-expr-2.cpp')
| -rw-r--r-- | test/SemaTemplate/instantiate-expr-2.cpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/test/SemaTemplate/instantiate-expr-2.cpp b/test/SemaTemplate/instantiate-expr-2.cpp index 80f403ed56fe..146e63c5bb00 100644 --- a/test/SemaTemplate/instantiate-expr-2.cpp +++ b/test/SemaTemplate/instantiate-expr-2.cpp @@ -130,3 +130,51 @@ struct X0 { void test_X0(X0<int> x, IntegralConstant<int, sizeof(int)> ic) { x.f(5,ic); } + +namespace N8 { + struct X { + X operator+(const X&) const; + }; + + template<typename T> + T test_plus(const T* xp, const T& x, const T& y) { + x.operator+(y); + return xp->operator+(y); + } + + void test_test_plus(X x) { + test_plus(&x, x, x); + } +} + +namespace N9 { + struct A { + bool operator==(int value); + }; + + template<typename T> struct B { + bool f(A a) { + return a == 1; + } + }; + + template struct B<int>; +} + +namespace N10 { + template <typename T> + class A { + struct X { }; + + public: + ~A() { + f(reinterpret_cast<X *>(0), reinterpret_cast<X *>(0)); + } + + private: + void f(X *); + void f(X *, X *); + }; + + template class A<int>; +} |
