summaryrefslogtreecommitdiff
path: root/gcc/cp/NEWS
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2002-12-10 07:11:46 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2002-12-10 07:11:46 +0000
commit0fe26a8677615902a386de4b529da27ec82b6e98 (patch)
tree10efb1e00f08d1c153c8fc7a4cba8cd1a174029f /gcc/cp/NEWS
parent7e15d8d465e2cf29663f683c7680f7f20229cd2a (diff)
downloadgcc-0fe26a8677615902a386de4b529da27ec82b6e98.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@59980 138bc75d-0d04-0410-961f-82ee72b054a4
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 85642b587d9..36720c60443 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