| 2004-08-06 Alexandre Oliva <aoliva@redhat.com> |
| |
| * parse.y (structsp): Skip typename_type obtained from a |
| class_head_decl, use the actual type. |
| |
| 2004-08-09 Alexandre Oliva <aoliva@redhat.com> |
| |
| * g++.old-deja/g++.pt/crash43.C: Don't require error for legal |
| construct. |
| * g++.dg/template/friend0.C: New test. |
| |
| |
| |
| @@ -2371,6 +2374,13 @@ structsp: |
| | class_head_decl |
| { |
| $$.t = TREE_TYPE ($1.t); |
| + /* class_head_decl always starts with an aggr, so |
| + get rid of any implicit typename warnings we |
| + might get from it. We can't remove it before |
| + this point because this is where we get from the |
| + decl to the type. */ |
| + if (IMPLICIT_TYPENAME_P ($$.t)) |
| + $$.t = TREE_TYPE ($$.t); |
| $$.new_type_flag = $1.new_type_flag; |
| check_class_key (current_aggr, $$.t); |
| } |
| |
| |
| @@ -7,7 +7,7 @@ struct S { |
| struct Y {}; |
| |
| template <int U> |
| - friend struct S<U>::X; // ERROR - typename as friend |
| + friend struct S<U>::X; // gets bogus error - XFAIL *-*-* |
| |
| template <int U> |
| friend typename S<U>::Y; // ERROR - typename as friend |
| @@ -15,7 +15,7 @@ struct S { |
| |
| struct T { |
| template <int T> |
| - friend struct S<T>::X; // ERROR - typename as friend |
| + friend struct S<T>::X; |
| }; |
| |
| struct U { |
| |
| |
| @@ -0,0 +1,10 @@ |
| +// http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=129350 |
| +// { dg-do compile } |
| + |
| +template<class T> struct A { |
| + struct B { }; |
| +}; |
| + |
| +class C { |
| + template<class T> friend struct A<T>::B; |
| +}; |