Incorrect behaviour of the compiler in C++

robin 'xer.xes' putters robin@games.lostboys.com
Wed Aug 30 03:31:00 GMT 2000


The following code should speak for itself. Looks like something goes wrong
with the way GCC is handling typedef's..

Is this a known bug? Is there a patch for it?

(btw. I've tried various compilers. 2.7.2.3 on linux, 2.91.something on
linux, 2.95.2 on playstation, windows (cygwin), and linux.)

//
// test.cpp(34) : conflicting types for `typedef const class ClsRef
constClsRef'
// test.cpp(29) : previous declaration as `typedef class Templ<Cls>
constClsRef'
//

//
// Just a class
//
class Cls;

//
// Just a template
//
template <typename taTYPE> class Templ;

//
//
//
typedef Templ<Cls> ClsRef;

//
// First forward declaration
//
typedef const ClsRef constClsRef;

//
// Second forward declaration
//
typedef const ClsRef constClsRef;  // line 29

//
// Third forward declaration.
//
typedef const ClsRef constClsRef;  // line 34




robin 'xer.xes' putters
lost boys games
robin@games.lostboys.com
-------------- next part --------------
//
// test.cpp(34) : conflicting types for `typedef const class ClsRef constClsRef'
// test.cpp(29) : previous declaration as `typedef class Templ<Cls> constClsRef'
//

//
// Just a class
//
class Cls;

//
// Just a template
//
template <typename taTYPE> class Templ;

//
// 
//
typedef Templ<Cls> ClsRef;

//
// First forward declaration
//
typedef const ClsRef constClsRef;		

//
// Second forward declaration
//
typedef const ClsRef constClsRef;		// line 29

//
// Third forward declaration.
//
typedef const ClsRef constClsRef;		// line 34



More information about the Cygwin mailing list