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++/11393] New: Initializer of static const float class member is not legal in c++98


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


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