This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/21499] declaration/initialization of non-integral member constants: compiler does not emit error
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 May 2005 17:58:49 -0000
- Subject: [Bug c++/21499] declaration/initialization of non-integral member constants: compiler does not emit error
- References: <20050510174115.21499.papadopo@shfj.cea.fr>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-05-10 17:58 -------
(In reply to comment #2)
> I don't understand.
>
> If it is a problem, how does the standard not require to diagnostic?
>
> At least the Stroustrup book is very clear about this. Anyway...
No what I mean the problem with non-integral member constant is required to be diagnose but the
requirement for integral member constants being defined does not have to be.
And the reason for not requiring the diagnose is the following, take the following two TUs:
---- tu1 ----
class a { static const int i = 0; }
int f = a::i;
---- tu2 -----
class a { static const int i = 0; }
const int a::i;
so how would we actually cause diagnose the problem for not defining a::i.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21499