Commit 82c18d5c by Nathan Sidwell Committed by Nathan Sidwell

extend.texi (Deprecated): Deprecate new initializer lists.

.:	* 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
parent 48ce6bbb
2001-02-12 Nathan Sidwell <nathan@codesourcery.com> 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 * mkdeps.c (deps_add_default_target): Robustify. Add
basename component only. basename component only.
* cpp.texi (-M): Describe how default target is generated. * cpp.texi (-M): Describe how default target is generated.
......
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> 2001-02-12 Mark Mitchell <mark@codesourcery.com>
Remove old ABI support. Remove old ABI support.
......
...@@ -265,8 +265,7 @@ cp_deprecated (msg) ...@@ -265,8 +265,7 @@ cp_deprecated (msg)
extern int warn_deprecated; extern int warn_deprecated;
if (!warn_deprecated) if (!warn_deprecated)
return; return;
cp_warning ("%s is deprecated.", msg); cp_warning ("%s is deprecated, please see the documentation for details", msg);
cp_warning ("Please see the documentation for details.");
} }
void void
......
...@@ -1290,11 +1290,14 @@ new_initializer: ...@@ -1290,11 +1290,14 @@ new_initializer:
} }
/* GNU extension so people can use initializer lists. Note that /* GNU extension so people can use initializer lists. Note that
this alters the meaning of `new int = 1', which was previously 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 | '=' init
{ {
if (pedantic) if (pedantic)
pedwarn ("ISO C++ forbids initialization of new expression with `='"); pedwarn ("ISO C++ forbids initialization of new expression with `='");
cp_deprecated ("new initializer lists extension");
if (TREE_CODE ($2) != TREE_LIST if (TREE_CODE ($2) != TREE_LIST
&& TREE_CODE ($2) != CONSTRUCTOR) && TREE_CODE ($2) != CONSTRUCTOR)
$$ = build_tree_list (NULL_TREE, $2); $$ = build_tree_list (NULL_TREE, $2);
......
...@@ -4390,6 +4390,9 @@ it is required for backwards compatibility @xref{Backwards Compatibility}. ...@@ -4390,6 +4390,9 @@ it is required for backwards compatibility @xref{Backwards Compatibility}.
The named return value extension has been deprecated, and will be The named return value extension has been deprecated, and will be
removed from g++ at some point. 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 @node Backwards Compatibility
@section Backwards Compatibility @section Backwards Compatibility
@cindex Backwards Compatibility @cindex Backwards Compatibility
......
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> 2001-02-12 Jakub Jelinek <jakub@redhat.com>
* gcc.c-torture/compile/20010209-1.c: New test. * gcc.c-torture/compile/20010209-1.c: New test.
......
...@@ -2,4 +2,6 @@ ...@@ -2,4 +2,6 @@
// Build don't link: // Build don't link:
// Special g++ Options: // Special g++ Options:
int *f(){ return new int[1] = { 1 }; } int *f(){
return new int[1] = { 1 }; // WARNING - deprecated
}
...@@ -11,6 +11,6 @@ public: ...@@ -11,6 +11,6 @@ public:
main() { main() {
A* a; A* a;
a = new A[2] = { A(1,false), A(1,false) } ;
a = new A[2](1,false); a = new A[2](1,false);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment