------- Comment #16 from mmitchel at gcc dot gnu dot org 2006-01-18 21:55
-------
I'm still wrestling with this PR.
As I suggested earlier, I turned off the caching of nested-name-specifiers
unless we're in the check_dependency_p case. However, that causes
g++.dg/parse/operator2.C to fail, for essentially the opposite reason.
On:
template <typename T> B<T>::C::operator typename B<T>::Y::X() const { return
0;\
}
we cache the check_dependency_p lookup for B<T>::C, which is "typename
B<T>::C". As a result, we don't enter the scope of B<T>::C when looking up
names in the type-specifier following the operator.
I think that we could fix that in cp_paser_conversion_function_id (by using
resolve_typename_type), but I'm afraid that it's not really safe to cache
either version of the nested-name-specifier lookup, and then return it for the
other case of check_dependency_p.
Still thinking.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22136