| 1 |
// Contributed by Dodji Seketeli <[email protected]> |
| 2 |
// Origin PR c++/40007 |
| 3 |
// { dg-do compile } |
| 4 |
|
| 5 |
class x |
| 6 |
{ |
| 7 |
typedef int privtype; // { dg-message "private" } |
| 8 |
|
| 9 |
protected: |
| 10 |
typedef int type; |
| 11 |
}; |
| 12 |
|
| 13 |
template<typename T> |
| 14 |
struct y : public x |
| 15 |
{ |
| 16 |
typename x::type z; |
| 17 |
}; |
| 18 |
|
| 19 |
template<typename T> |
| 20 |
struct y<T*> : public x |
| 21 |
{ |
| 22 |
typedef x::type good; |
| 23 |
typedef x::privtype bad; // { dg-error "within this context" } |
| 24 |
}; |
| 25 |
|
| 26 |
template class y<int>; |
| 27 |
template class y<int*>; |