--- Comment #6 from redi at gcc dot gnu dot org 2010-07-27 23:54 ---
(In reply to comment #5)
> Thanks for all the great comments and insight.
>
> I'm still confused as to why when the BUFF_SIZE was defined as:
> static const signed int BUFF_SIZE = 20;
> it caused the error, but when
--- Comment #5 from rwitmer at xmission dot com 2010-07-27 15:27 ---
Thanks for all the great comments and insight.
I'm still confused as to why when the BUFF_SIZE was defined as:
static const signed int BUFF_SIZE = 20;
it caused the error, but when it was defined as:
static const uns
--- Comment #4 from redi at gcc dot gnu dot org 2010-07-26 16:37 ---
(In reply to comment #3)
>
> If you only want it to be used as an integral constant, don't use it in a
> context that requires a variable (e.g. reference binding)
e.g.
funky((int)myclass::BUFF_SIZE);
This means th
--- Comment #3 from redi at gcc dot gnu dot org 2010-07-26 16:32 ---
(In reply to comment #2)
> The bug/feature may be that re-typing BUFF_SIZE to static const unsigned int
> allows the compiler to not report a problem.
You're not "re-typing" it, you're providing a definition for a vari
--- Comment #2 from rwitmer at xmission dot com 2010-07-26 15:59 ---
I agree with your assessment. Adding const int myclass::BUFF_SIZE; resolves
the issue.
The bug/feature may be that re-typing BUFF_SIZE to static const unsigned int
allows the compiler to not report a problem. It doe
--- Comment #1 from jakub at gcc dot gnu dot org 2010-07-26 15:32 ---
This is not valid C++. See [class.static.data]/4:
If a static data member is of const integral or const enumeration type, its
declaration in the class definition can specify a constant-initializer which
shall be an in