| 1 |
// { dg-do compile { target c++11 } } |
| 2 |
|
| 3 |
struct A { |
| 4 |
template <class U> using C = U; |
| 5 |
}; |
| 6 |
|
| 7 |
// The particularity of the below struct is to have more than 7 |
| 8 |
// fields. In this case, looking up a member here should exercise |
| 9 |
// cp/search.c:lookup_field_1 in such a way that it finds it in the |
| 10 |
// CLASSTYPE_SORTED_FIELDS of struct A7. |
| 11 |
struct A7 { |
| 12 |
int f0; |
| 13 |
int f1; |
| 14 |
int f2; |
| 15 |
int f3; |
| 16 |
int f4; |
| 17 |
int f5; |
| 18 |
int f6; |
| 19 |
int f7; |
| 20 |
template <class U> using C = U; |
| 21 |
}; |
| 22 |
|
| 23 |
template <class T> |
| 24 |
struct B { |
| 25 |
typename T::template C<int> n; //#0 |
| 26 |
}; |
| 27 |
|
| 28 |
// These should trigger the lookup |
| 29 |
// of template C inside class A or |
| 30 |
// A7, via #0. |
| 31 |
B<A> b; |
| 32 |
B<A7> c; |