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]

Misleading (incorrect?) error message



Hi,

Try to compile this short test program:

typedef struct
{
} GC;       // Line 3

class AClass
{
   GC *TheGC;  // Line 7
   public:

   AClass *GC;  // Line 10
}; 

> eg++ -c t.cc
t.cc:10: declaration of identifier `GC' as `class AClass * GC'
t.cc:3: conflicts with other use in class as `struct GC'

The warning says that the declaration at line 10 conflicts with the
'other' use with the type 'struct GC' and points to line 3, the definition
of 'struct GC'

IMHO this is confusing and should read
 t.cc:10: declaration of identifier 'GC' as 'class AClass * GC'
 t.cc:7: conflicts with other use in class as 'struct GC'

Which seems more consistant and usefull.

This is with egcs snapshot 970904.

Thanks,
Jason



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