From: "Richard Guenther" <richard.guenther@gmail.com>
To: "Dragan Milenkovic" <dragan@plusplus.co.yu>
Cc: gcc@gcc.gnu.org
Subject: Re: A simple sample code involving templates, friends and lookup
Date: Thu, 17 Jan 2008 12:56:00 -0000 [thread overview]
Message-ID: <84fc9c000801170449j332abd0bp501bbc2fd9d04c46@mail.gmail.com> (raw)
In-Reply-To: <478F3175.2050809@plusplus.co.yu>
On Jan 17, 2008 11:44 AM, Dragan Milenkovic <dragan@plusplus.co.yu> wrote:
> 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.
Actually even with the weird line the program is invalid. What are
you trying to do? ;)
Richard.
next prev parent reply other threads:[~2008-01-17 12:49 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-17 11:08 Dragan Milenkovic
2008-01-17 12:56 ` Richard Guenther [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=84fc9c000801170449j332abd0bp501bbc2fd9d04c46@mail.gmail.com \
--to=richard.guenther@gmail.com \
--cc=dragan@plusplus.co.yu \
--cc=gcc@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).