This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/11393] New: Initializer of static const float class member is not legal in c++98
- From: "rearnsha at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Jul 2003 17:25:00 -0000
- Subject: [Bug c++/11393] New: Initializer of static const float class member is not legal in c++98
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11393
Summary: Initializer of static const float class member is not
legal in c++98
Product: gcc
Version: 3.4
Status: UNCONFIRMED
Keywords: accepts-invalid
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: rearnsha at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: any
The following code is not legal in c++ 98 (9.4.2 par 4) and should generate a
diagnostic. As this is probably a gnu extension, it should probably only do
this when -std=c++98.
g++ -std=c++98 foo.cc
class A { // OK
static const int a = 1;
};
class B { // Not legal
static const float pi = 3.1415926;
};