This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/27665] [4.0/4.1/4.2 regression] ICE writing class instead of typename
- From: "mmitchel at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Jun 2006 00:06:50 -0000
- Subject: [Bug c++/27665] [4.0/4.1/4.2 regression] ICE writing class instead of typename
- References: <bug-27665-1771@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from mmitchel at gcc dot gnu dot org 2006-06-15 00:06 -------
The problem here is with the parser optimization by which the results of
parsing a nested-name-specifier is cached, even if the parser backs up. Here,
we consider that "class A<N>::B::C" might be a class-head. In that context,
the dependent name A<N>::B should be resolved. Therefore, the saved version of
the nested-name specifier is the class A<N>::B, rather than typename A<N>::B.
Then, since this is not in fact a class-head, we back up and try again, parsing
the construct as an elaborated-type-specifier. In that context, we should get
the typename -- but do not, due to the caching.
However, in this case A<N>::B shouldn't really be permitted to refer to the
class, even if it were part of a class-head, as we A<N> is not the same thing
as the abstract uninstantiated A.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27665