This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Confusing warning (?)
- To: egcs-bugs at cygnus dot com
- Subject: Confusing warning (?)
- From: Carlo Wood <carlo at runaway dot xs4all dot nl>
- Date: Sun, 4 Apr 1999 14:38:30 +0200 (CEST)
Hiya,
I had a minute or two long problems understanding this warning.
Can this warning message be improved?
File to reproduce the problem:
------------------------------------------------------------------------------
#include <set>
struct asymbol { long value; };
class symbol_key_ct {
private:
asymbol *symbol;
public:
symbol_key_ct(asymbol *p) : symbol(p) { }
bool operator<(symbol_key_ct b) const
{ return symbol->value < b.symbol->value; }
bool operator>(symbol_key_ct b) const
{ return symbol->value > b.symbol->value; }
bool operator==(symbol_key_ct b) const
{ return symbol->value == b.symbol->value; }
}
#if 0
The line below causes this problem:
>g++ -c warning.cc
warning.cc:28: `set<symbol_key_ct,less<symbol_key_ct>,__default_alloc_template<true,0> >' specified as declarator-id
warning.cc:28: syntax error before `;'
#endif
typedef set<symbol_key_ct> function_symbols_ct; // THIS IS LINE 28
------------------------------------------------------------------------------
Just wanted to let you know,
--
Carlo Wood <carlo@runaway.xs4all.nl>
PS Yes, I know what is wrong ;).