This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
friend declaration implicitly provides a prototype
- From: Bernardo Innocenti <bernie at develer dot com>
- To: GCC Mailing List <gcc at gcc dot gnu dot org>
- Date: Tue, 16 Dec 2003 21:57:43 +0100
- Subject: friend declaration implicitly provides a prototype
- Organization: Develer S.r.l.
Hello,
this strikes me as a C++ bug in GCC 3.3.2, but perhaps
I'm just not correctly reading through the lines of the
standard.
class Foo
{
// No prototype for bar() given
friend void bar(int);
};
void some_function()
{
bar(10); // No error for undeclared function!
}
What the standard explicitly requires is that bar()
can be accessed in Foo as if it was declared.
This doesn't mean bar(int) is implicitly declared
everywhere, right?
--
// Bernardo Innocenti - Develer S.r.l., R&D dept.
\X/ http://www.develer.com/