This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/11713] New: c++ parser error


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11713

           Summary: c++ parser error
           Product: gcc
           Version: 3.3.1
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: debian-gcc at lists dot debian dot org
                CC: gcc-bugs at gcc dot gnu dot org

[forwarded from http://bugs.debian.org/203351]

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 HEAD.

//////////////////////// 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 ///////////


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]