[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gcc-bugs
Subject:    Confusing warning (?)
From:       Carlo Wood <carlo () runaway ! xs4all ! nl>
Date:       1999-04-04 12:38:30
[Download RAW message or body]

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic