| 1 |
// PR c++/14258 |
| 2 |
// { dg-do run } |
| 3 |
|
| 4 |
template<typename T> |
| 5 |
struct A |
| 6 |
{ |
| 7 |
typedef T type; |
| 8 |
typedef A type2; |
| 9 |
}; |
| 10 |
|
| 11 |
template<typename T> |
| 12 |
struct B : A<T> |
| 13 |
{ |
| 14 |
using typename A<T>::type; |
| 15 |
type t; |
| 16 |
|
| 17 |
using typename A<T>::type2; |
| 18 |
|
| 19 |
type f() |
| 20 |
{ |
| 21 |
type i = 1; |
| 22 |
return i; |
| 23 |
} |
| 24 |
}; |
| 25 |
|
| 26 |
int main() |
| 27 |
{ |
| 28 |
B<int>::type t = 4; |
| 29 |
if (t != 4) |
| 30 |
__builtin_abort(); |
| 31 |
|
| 32 |
B<double> b; |
| 33 |
b.t = 3; |
| 34 |
if (b.t != 3) |
| 35 |
__builtin_abort(); |
| 36 |
|
| 37 |
B<long> b2; |
| 38 |
if (b2.f() != 1) |
| 39 |
__builtin_abort(); |
| 40 |
|
| 41 |
B<double>::type2::type tt = 12; |
| 42 |
if (tt != 12) |
| 43 |
__builtin_abort(); |
| 44 |
} |