Package: g++-3.3 Version: 1:3.3.1-0rc1 Severity: important The g++-3.3 parser fails to parse the code bellow with the following error message: test.cc:33: error: declaration of `Bitmap::operator GdkBitmap*() const' test.cc:23: error: conflicts with previous declaration `Bitmap::operator GdkBitmap*() const'
This code compiles cleanly with g++-3.2. Some changes to the code, e.g. move the class Event to the end of the file, makes the file to compile cleanly with g++-3.3. The problem also exists in current gcc-snapshot. //////////////////////// Code starts here ////////////////////////////////////// typedef struct _GdkDrawable GdkDrawable; typedef struct _GdkDrawable GdkBitmap; typedef struct _GdkDrawable GdkPixmap; class Drawable { public: operator GdkDrawable* () const; }; class Pixmap : public Drawable { public: operator GdkPixmap* () const; }; class Bitmap : public Pixmap { public: operator GdkBitmap* () const; }; class Event { }; Bitmap::operator GdkBitmap* () const { return 0; } ///// Code ends here /////////// -- System Information: Debian Release: testing/unstable Architecture: i386 Kernel: Linux maestro 2.4.18-k7 #1 SMP Qua Jun 25 20:03:38 BRT 2003 i686 Locale: LANG=C, LC_CTYPE=C Versions of packages g++-3.3 depends on: ii gcc-3.3 1:3.3.1-0rc1 The GNU C compiler ii gcc-3.3-base 1:3.3.1-0rc1 The GNU Compiler Collection (base ii libc6 2.3.1-17 GNU C Library: Shared libraries an ii libstdc++5-3.3-dev 1:3.3.1-0rc1 The GNU Standard C++ Library v3 (d -- no debconf information