gcc/testsuite/g++.dg/cpp0x/enum5.C
raw| 1 | // PR c++/40639 |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | |
| 4 | template< typename T > |
| 5 | struct wrap { |
| 6 | enum E : T { val }; |
| 7 | }; |
| 8 | |
| 9 | template< typename T > |
| 10 | struct dependant { |
| 11 | enum E : typename T::type { val }; |
| 12 | }; |
| 13 | |
| 14 | template<typename T> |
| 15 | struct identity { |
| 16 | typedef T type; |
| 17 | }; |
| 18 | |
| 19 | wrap<int> x; |
| 20 | dependant<identity<int>> y; |