diff options
| author | Roman Divacky <rdivacky@FreeBSD.org> | 2009-11-05 17:18:09 +0000 |
|---|---|---|
| committer | Roman Divacky <rdivacky@FreeBSD.org> | 2009-11-05 17:18:09 +0000 |
| commit | 8f57cb0305232cb53fff00ef151ca716766f3437 (patch) | |
| tree | 8b316eca843681b024034db1125707173b9adb4a /test/CodeGenCXX/ptr-to-datamember.cpp | |
| parent | 51fb8b013e7734b795139f49d3b1f77c539be20a (diff) | |
Notes
Diffstat (limited to 'test/CodeGenCXX/ptr-to-datamember.cpp')
| -rw-r--r-- | test/CodeGenCXX/ptr-to-datamember.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/CodeGenCXX/ptr-to-datamember.cpp b/test/CodeGenCXX/ptr-to-datamember.cpp index a7b4cc2f7afb9..ffaef32a13c9c 100644 --- a/test/CodeGenCXX/ptr-to-datamember.cpp +++ b/test/CodeGenCXX/ptr-to-datamember.cpp @@ -32,6 +32,15 @@ public: F Af; }; +template <typename T> struct TT { + int T::t::*pti; +}; + +struct I { + typedef I t; + int x; +}; + void pr(const F& b) { printf(" %d %f\n", b.iF, b.fF); } @@ -69,9 +78,12 @@ void test_aggr_pdata_1(A* pa) { int main() { A a1; + TT<I> tt; + I i; int A::* pa = &A::Ai; float A::* pf = &A::f; double A::* pd = &A::d; + tt.pti = &I::x; printf("%d %d %d\n", &A::Ai, &A::f, &A::d); printf("%d\n", &A::B::iB); printf("%d\n", &A::B1::iB1); @@ -81,6 +93,7 @@ int main() printf("%d\n", &A::B::V::iV); printf("%d\n", &A::B1::V::iV); printf("%d, %f, %f \n", a1.*pa, a1.*pf, a1.*pd); + printf("%d\n", i.*tt.pti); test_aggr_pdata(a1); test_aggr_pdata_1(&a1); } |
