gcc/testsuite/g++.dg/cpp0x/pr79457.C
raw| 1 | // PR c++/79457 |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | |
| 4 | template <typename T> |
| 5 | class Foo |
| 6 | { |
| 7 | private: |
| 8 | T& goo; |
| 9 | template <typename R> |
| 10 | using S = decltype (goo[R ()]); |
| 11 | |
| 12 | public: |
| 13 | Foo (T& goo) : goo {goo} {} |
| 14 | |
| 15 | template <typename R> |
| 16 | S<R> boo () {} |
| 17 | }; |
| 18 | |
| 19 | int |
| 20 | main () |
| 21 | { |
| 22 | int bar[] = {1, 2, 3}; |
| 23 | Foo<decltype (bar)> foo {bar}; |
| 24 | } |