Jonathan Wakely wrote:
On 17/01/2008, Richard Guenther wrote:
Well, a language lawyer can probably clear things up. From a look
at the std it looks like w/o a previous declaration the above should
be invalid. And at a different point it suggests the decl becomes
available.
Yes, at the point
Richard Guenther wrote:
[snip]
template
struct Foo
{
template
friend void func(const Foo &);
};
void check(const Foo & x)
{
// Foo weird; // uncomment this line and all works
func(x);// <-- ERROR
}
Tested with gcc 4.0 - 4.3, and all behave the same:
"error: 'func'
// Foo weird; // uncomment this line and all works
func(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