This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/33750] initialization of non-integral member constant not rejected



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]