This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/33750] New: 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 13:58:32 -0000
- Subject: [Bug c++/33750] New: initialization of non-integral member constant not rejected
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
struct foo
{
static const float bar = 1.2;
};
is accepted without a warning. It is rejected with -pedantic.
from cp/decl.c:
else if (pedantic && !INTEGRAL_TYPE_P (type))
pedwarn ("ISO C++ forbids initialization of member constant "
"%qD of non-integral type %qT", decl, type);
why do we guard the pedwarn with if (pedantic)??
--
Summary: initialization of non-integral member constant not
rejected
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: accepts-invalid, diagnostic
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: rguenth at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33750