gcc/testsuite/g++.dg/template/typedef23.C
raw| 1 | // Contributed by Dodji Seketeli <[email protected]> |
| 2 | // Origin PR c++/42069 |
| 3 | // { dg-do compile } |
| 4 | |
| 5 | struct A |
| 6 | { |
| 7 | static const int N = 0; |
| 8 | }; |
| 9 | |
| 10 | template<int> struct B {}; |
| 11 | |
| 12 | template<typename T, int> |
| 13 | struct C |
| 14 | { |
| 15 | typedef T U; |
| 16 | B<U::N> b; |
| 17 | }; |
| 18 | |
| 19 | template<typename T> |
| 20 | struct C<T*, 0> |
| 21 | { |
| 22 | B<T::N> b; |
| 23 | }; |
| 24 | |
| 25 | C<A*, 0> c; |