This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/18681] [3.4/4.0/4.1 Regression] template friend declaration not recognized



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]