extend.texi (Deprecated): Deprecate new initializer lists.
authorNathan Sidwell <nathan@codesourcery.com>
Mon, 12 Feb 2001 14:29:13 +0000 (14:29 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Mon, 12 Feb 2001 14:29:13 +0000 (14:29 +0000)
.: * extend.texi (Deprecated): Deprecate new initializer lists.
cp:
* errfn.c (cp_deprecated): Tweak diagnostic text.
* parse.y (new_initializer): Deprecate initializer lists
extension.
testsuite:
* g++.old-deja/g++.robertl/eb63.C: Remove new initializer list
case.
* g++.old-deja/g++.ext/arrnew.C: Deprecate.

From-SVN: r39603

gcc/ChangeLog
gcc/cp/ChangeLog
gcc/cp/errfn.c
gcc/cp/parse.y
gcc/extend.texi
gcc/testsuite/ChangeLog
gcc/testsuite/g++.old-deja/g++.ext/arrnew.C
gcc/testsuite/g++.old-deja/g++.robertl/eb63.C

index 5838071d35d923c8ab073846b9028b9b4c7846ab..51837d02b5e64ad23217be37692c7689df6e5103 100644 (file)
@@ -1,3 +1,7 @@
+2001-02-12  Nathan Sidwell  <nathan@codesourcery.com>
+
+       * extend.texi (Deprecated): Deprecate new initializer lists.
+
 2001-02-12  Nathan Sidwell  <nathan@codesourcery.com>
 
        * mkdeps.c (deps_add_default_target): Robustify. Add
index 6e1cb900c637d42a3e71b80dab52e568facbdfe2..3f7b3922d49b2c02230cc119875ce529346f2b25 100644 (file)
@@ -1,3 +1,9 @@
+2001-02-12  Nathan Sidwell  <nathan@codesourcery.com>
+
+       * errfn.c (cp_deprecated): Tweak diagnostic text.
+       * parse.y (new_initializer): Deprecate initializer lists
+       extension.
+
 2001-02-12  Mark Mitchell  <mark@codesourcery.com>
 
        Remove old ABI support.
index 802f5676ee77e1115a5d34bc06d56a6654322fbe..351dba958884b2320dbd9d47d9f4116275cab951 100644 (file)
@@ -265,8 +265,7 @@ cp_deprecated (msg)
   extern int warn_deprecated;
   if (!warn_deprecated)
     return;
-  cp_warning ("%s is deprecated.", msg);
-  cp_warning ("Please see the documentation for details.");
+  cp_warning ("%s is deprecated, please see the documentation for details", msg);
 }
 
 void
index e84efb53a73619864b5d4731d4db546352386047..a9963ee7691498ea68e6da0de02e38966acfdb57 100644 (file)
@@ -1290,11 +1290,14 @@ new_initializer:
                }
        /* GNU extension so people can use initializer lists.  Note that
           this alters the meaning of `new int = 1', which was previously
-          syntactically valid but semantically invalid.  */
+          syntactically valid but semantically invalid.  
+           This feature is now deprecated and will be removed in a future
+           release.  */
        | '=' init
                {
                  if (pedantic)
                    pedwarn ("ISO C++ forbids initialization of new expression with `='");
+                 cp_deprecated ("new initializer lists extension");
                  if (TREE_CODE ($2) != TREE_LIST
                      && TREE_CODE ($2) != CONSTRUCTOR)
                    $$ = build_tree_list (NULL_TREE, $2);
index c1d523378eee0b07ba160310dcb233034b280013..c2ce6a39f4ce9d81fbe1376033dbf9953728dab9 100644 (file)
@@ -4390,6 +4390,9 @@ it is required for backwards compatibility @xref{Backwards Compatibility}.
 The named return value extension has been deprecated, and will be
 removed from g++ at some point.
 
+The use of initializer lists with new expressions has been deprecated,
+and will be removed from g++ at some point.
+
 @node Backwards Compatibility
 @section Backwards Compatibility
 @cindex Backwards Compatibility
index c8832787c323d4ee79b77e71312c3f3656bbc25c..de55bb37764ff6838d5d559443eb4d60ce45d96d 100644 (file)
@@ -1,3 +1,9 @@
+2001-02-12  Nathan Sidwell  <nathan@codesourcery.com>
+
+       * g++.old-deja/g++.robertl/eb63.C: Remove new initializer list
+       case.
+       * g++.old-deja/g++.ext/arrnew.C: Deprecate.
+
 2001-02-12  Jakub Jelinek  <jakub@redhat.com>
 
        * gcc.c-torture/compile/20010209-1.c: New test.
index ef051d265a048d1d5fc60714b320c8d0944e768e..0ecb8777e2697999f074781ded27c38f1d6a57be 100644 (file)
@@ -2,4 +2,6 @@
 // Build don't link:
 // Special g++ Options:
 
-       int *f(){ return new int[1] = { 1 };   }
+int *f(){
+  return new int[1] = { 1 };   // WARNING - deprecated
+}
index 671fe81320065087e5b400300b87bbe58c552554..f786e707923b6262a0cc4206001c51e989de7f35 100644 (file)
@@ -11,6 +11,6 @@ public:
 
 main() {
         A* a;
-       a = new A[2] = { A(1,false), A(1,false) } ;
+
         a = new A[2](1,false);
 }