public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* A simple sample code involving templates, friends and lookup
@ 2008-01-17 11:08 Dragan Milenkovic
  2008-01-17 12:56 ` Richard Guenther
  0 siblings, 1 reply; 13+ messages in thread
From: Dragan Milenkovic @ 2008-01-17 11:08 UTC (permalink / raw)
  To: gcc

Hello,

I'm aware about these issues being around for quite a while now, but
there is still a chance this sample code can be helpful. I apologize
if someone gets annoyed :-P


template <typename T>
struct Foo
{
     template <typename Z>
     friend void func(const Foo &);
};

void check(const Foo<int> & x)
{
     // Foo<int> weird;  // uncomment this line and all works

     func<int>(x);    // <-- ERROR
}


Tested with gcc 4.0 - 4.3, and all behave the same:

"error: ‘func’ was not declared in this scope"

but it works if you uncomment the weird line.


Best regards,

Dragan Milenkovic

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2008-01-18 21:13 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-17 11:08 A simple sample code involving templates, friends and lookup Dragan Milenkovic
2008-01-17 12:56 ` Richard Guenther
2008-01-17 13:24   ` Dragan Milenkovic
2008-01-17 14:46     ` Richard Guenther
2008-01-17 17:12       ` Ian Lance Taylor
2008-01-17 18:09         ` Richard Guenther
2008-01-17 22:23           ` Ian Lance Taylor
2008-01-17 22:59             ` Richard Guenther
2008-01-18  7:10               ` Jonathan Wakely
2008-01-18  7:35                 ` Jonathan Wakely
2008-01-18 14:17                 ` Dragan Milenkovic
2008-01-19  8:21                   ` Jonathan Wakely
2008-01-17 13:35   ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).