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]

Confusing warning (?)


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 ;).


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