gcc/testsuite/g++.dg/template/typename5.C
raw| 1 | // { dg-do compile } |
| 2 | |
| 3 | // Origin: [email protected] |
| 4 | |
| 5 | // PR c++/2513: typename handling when scope is dependent as |
| 6 | // described in DR108. |
| 7 | |
| 8 | template <bool flag> struct Select { |
| 9 | typedef int Result; |
| 10 | }; |
| 11 | |
| 12 | template <template<class> class Pred> struct FindType { |
| 13 | typedef typename Select<true>::Result Result; |
| 14 | }; |
| 15 | |
| 16 | template <int bits> struct Int { |
| 17 | template<typename T> struct RightSize {}; |
| 18 | typedef typename FindType<RightSize>::Result type; |
| 19 | }; |