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
This commit is contained in:
Nathan Sidwell 2001-02-12 14:29:13 +00:00 committed by Nathan Sidwell
parent 48ce6bbbe6
commit 82c18d5c67
8 changed files with 28 additions and 5 deletions

View 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

View 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.

View 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

View 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);

View 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

View 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.

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

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