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++/30390] New: cannot declare friend class of the parameter type in a template class


class R{}; 
class B{
   friend class R;    // ok.
};

template <typename T> class A{
  friend class T;     // error???
};

when using g++(3.3.3 or 4.1) to compile above code, it reports:
error: using template type parameter 'T' after 'class'
error: friend declaration does not name a class or function

Pls note that, SunCC works fine for above code.


-- 
           Summary: cannot declare friend class of the parameter type in a
                    template class
           Product: gcc
           Version: 3.3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: gzljg at hotmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30390


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