This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/18681] [3.4/4.0/4.1 Regression] template friend declaration not recognized
- 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: 31 Oct 2005 01:53:34 -0000
- Subject: [Bug c++/18681] [3.4/4.0/4.1 Regression] template friend declaration not recognized
- References: <bug-18681-7154@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #22 from mmitchel at gcc dot gnu dot org 2005-10-31 01:53 -------
Leaving as P2.
I'd like to have another think about this issue before 4.1. However, I'm not
overly optimistic that we can find a good solution quickly.
In looking at this example:
template <typename T_>
class C1
{
typedef typename C2<T_>::T_PAR_TYPE T_PAR;
struct S1
{
T_PAR par1; // #1
typename C2<T_>::T_PAR_TYPE par2; // #2
};
...
};
we might need to avoid using the same TYPENAME_TYPE node for TYPENAME_TYPEs
that are typedef'd and TYPENAME_TYPEs that are not. Note that for "int", we do
have separate type nodes for all "int" typedefs, so we would in fact be able to
tell how we got at a particular typedef.
However, this may be another case of the more general problem that we don't
preserve enough information about how we obtained a type or declaration to do
full access-checking in template instantiations.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18681