This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
2.95.1 C++ bug?
- To: gcc-bugs at gcc dot gnu dot org
- Subject: 2.95.1 C++ bug?
- From: JDonner <jdonner at schedsys dot com>
- Date: Thu, 09 Sep 1999 23:55:08 +0000
Hi,
The following produces an error on gcc 2.95.1;
VC6 sp3 accepts it fine; is this a bug?
thanks,
Jeff
// bugtest.cpp line 1
class ObjClass;
class Obj {};
class ObjClass : public Obj
{
public:
ObjClass(Obj *(pfnCreate)() = 0);
};
class D : public Obj
{
public:
static Obj* Create();
int Create(int n);
static const ObjClass classD;
};
// next is line 22
const ObjClass D::classD(D::Create);
Obj* D::Create() { return 0; }
int D::Create(int n) { return 0; }
int main()
{
return 0;
}
gcc -Wall bugtest.cpp
bugtest.cpp: In function `void
__static_initialization_and_destruction_0(int, int)':
bugtest.cpp:22: assuming & on overloaded member function
Compilation exited abnormally with code 1 at Thu Sep 9 19:51:10
gcc -v
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.1/specs
gcc version 2.95.1 19990816 (release)