http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49311

--- Comment #5 from Hartmut Schirmer <hartmut.schirmer at arcormail dot de> 
2011-06-08 05:25:44 UTC ---
> I think there are several hundred already.

Oh, this list was helpful, thanks!

> Not worth marking them as duplicate,
> it just further upsets people receiving notifications for a problem that has 
> no
> solution.

Looking at http://www2.research.att.com/~bs/bs_faq2.html#in-class I found this

  "You can take the address of a static member if (and only if) it has an
out-of-class definition"

Of course this is not a promise you don't need an out-of-class definition if
you don't take the address. Gcc uses the assumption it can take the address in
-O0 mode, but is this assumption justified? It's at least surprising.

class A
{
public:
  static const unsigned first = 1;
  enum { second = 2 };
};

should behave similar in all cases address of first isn't taken.

Reply via email to