aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/NEWS
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2002-12-10 07:11:46 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2002-12-10 07:11:46 +0000
commitdcba9b0fab084c394cbc664809868cbd8071b92e (patch)
tree10efb1e00f08d1c153c8fc7a4cba8cd1a174029f /gcc/cp/NEWS
parent63358530f8e01cd0317b9e377f5189edb8c36f37 (diff)
downloadgcc-dcba9b0fab084c394cbc664809868cbd8071b92e.zip
gcc-dcba9b0fab084c394cbc664809868cbd8071b92e.tar.gz
gcc-dcba9b0fab084c394cbc664809868cbd8071b92e.tar.bz2
re PR c++/8153 (ICE with static const member in class)
PR c++/8153 PR c++/8036 * NEWS: Document removal of in-class initialization extension for static data members of non-arithmetic, non-enumeration type. * decl.c (check_static_variable_definition): Do not allow that extension. * decl2.c (grokfield): Do not call digest_init when processing templates. PR c++/8153 PR c++/8036 * g++.dg/template/static1.C: New test. * g++.dg/template/static2.C: New test. * g++.old-deja/g++.ext/memconst.C: New test. From-SVN: r59980
Diffstat (limited to 'gcc/cp/NEWS')
-rw-r--r--gcc/cp/NEWS22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/cp/NEWS b/gcc/cp/NEWS
index 85642b5..36720c6 100644
--- a/gcc/cp/NEWS
+++ b/gcc/cp/NEWS
@@ -2,6 +2,28 @@
* The "new X = 3" extension has been removed; you must now use "new X(3)".
+* G++ no longer allows in-class initializations of static data members
+ that do not have arithmetic or enumeration type. For example:
+
+ struct S {
+ static const char* const p = "abc";
+ };
+
+ is no longer accepted.
+
+ Use the standards-conformant form:
+
+ struct S {
+ static const char* const p;
+ };
+
+ const char* const S::p = "abc";
+
+ instead.
+
+ (ISO C++ is even stricter; it does not allow in-class
+ initializations of floating-point types.)
+
*** Changes in GCC 3.1:
* -fhonor-std and -fno-honor-std have been removed. -fno-honor-std was