This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
const int null = 0;
- To: gcc-bugs at gcc dot gnu dot org
- Subject: const int null = 0;
- From: "Marc A. Lepage" <mlepage at molecularmining dot com>
- Date: Mon, 17 Apr 2000 15:28:26 -0400
- Organization: Molecular Mining Corporation
kafka$ gcc -v
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/specs
gcc version 2.95.2 19991024 (release)
kafka$ uname -a
Linux kafka 2.2.5 #1 SMP Mon Apr 12 02:29:46 EDT 1999 i686 unknown
kafka$ g++ null.cpp
null.cpp: In method `void Foo::g()':
null.cpp:27: no matching function for call to `Foo::f (const int &)'
null.cpp:21: candidates are: void Foo::f(int *)
null.cpp: In function `int main(int, char *)':
null.cpp:37: no matching function for call to `Foo::f (const int &)'
null.cpp:21: candidates are: void Foo::f(int *)
--
Marc A. Lepage
Software Developer
Molecular Mining Corporation
http://www.molecularmining.com/
const int null = 0;
void f(int* pn)
{
}
void g()
{
f(0);
f(null); // okay
}
class Foo
{
public:
void f(int* pn);
void g();
};
void Foo::f(int* pn)
{
}
void Foo::g()
{
f(0);
f(null); // compile error
}
int main(int argc, char* argv)
{
f(0);
f(null); // okay
Foo foo;
foo.f(0);
foo.f(null); // compile error
}