gcc/testsuite/g++.dg/template/ptrmem3.C
raw| 1 | // Origin: Theo Papadopoulo <[email protected]> |
| 2 | |
| 3 | template <typename T,double (T::*fun)() const> |
| 4 | struct I { |
| 5 | }; |
| 6 | |
| 7 | struct R { |
| 8 | R() { } |
| 9 | }; |
| 10 | |
| 11 | class H: public R { |
| 12 | public: |
| 13 | H(): R() { } |
| 14 | double& f() { return a; } |
| 15 | double f() const { return 1.0; } |
| 16 | double a; |
| 17 | }; |
| 18 | |
| 19 | struct A { |
| 20 | typedef I<H,&H::f> F; |
| 21 | A() { } |
| 22 | }; |