This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/33750] initialization of non-integral member constant not rejected
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Oct 2007 14:38:18 -0000
- Subject: [Bug c++/33750] initialization of non-integral member constant not rejected
- References: <bug-33750-10053@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from rguenth at gcc dot gnu dot org 2007-10-12 14:38 -------
No, -pedantic gives an error. -pedantic -fpermissive gives a warning on the
initialization but still an error on the FP literal:
tmp> g++-4.3 -c t.C
tmp> g++-4.3 -c t.C -pedantic
t.C:3: error: floating-point literal cannot appear in a constant-expression
t.C:3: error: ISO C++ forbids initialization of member constant 'bar' of
non-integral type 'const float'
tmp> g++-4.3 -c t.C -pedantic -fpermissive
t.C:3: error: floating-point literal cannot appear in a constant-expression
t.C:3: warning: ISO C++ forbids initialization of member constant 'bar' of
non-integral type 'const float'
so I cannot get only warnings for this.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33750