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++/24449] Unable to declare friend main() from class template



------- Comment #2 from machata at post dot cz  2005-11-10 14:21 -------
Created an attachment (id=10202)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10202&action=view)
Patch against gcc/cp/decl.c, and a testcase

This is rather straightforward solution for this PR. It allows parsing of the
code like this:
  template< class > class { friend int ::main(); };
But unfortunately also this:
  class { template< class > friend int ::main(); };
I'm going to investigate the latter case now, but I don't yet have enough
knowledge to propose a solution. IMHO this should fail, but maybe a warning is
enough?

The patch contains also a testcase. I tried to prepare the patch with all rules
in mind, but I could have overlooked something.


-- 


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


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