diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2004-11-01 18:24:33 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2004-11-01 18:24:33 +0000 |
commit | ae209f284cc478ff5839488722fd4f52a04c2eee (patch) | |
tree | eb7bbcedef1f0538d4cee0e79e23f9f2499a79bc /gcc/cp | |
parent | 464f49d80df8a5232a956a1ccc8ef78bd25b0110 (diff) | |
download | gcc-ae209f284cc478ff5839488722fd4f52a04c2eee.zip gcc-ae209f284cc478ff5839488722fd4f52a04c2eee.tar.gz gcc-ae209f284cc478ff5839488722fd4f52a04c2eee.tar.bz2 |
re PR c++/18064 (gcc accepts different pointer types as covariant return types)
cp:
PR c++/18064
* search.c (check_final_overrider): Deprecate gnu covariant extension.
doc:
PR c++/18064
* doc/extend.texi (Deprecated Features): Deprecate G++ covariant
extension.
testsuite:
PR c++/18064
* g++.old-deja/g++.mike/p811.C: Avoid covariant extension.
From-SVN: r89946
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/search.c | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index bea717b..022148e 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2004-11-01 Nathan Sidwell <nathan@codesourcery.com> + + PR c++/18064 + * search.c (check_final_overrider): Deprecate gnu covariant extension. + 2004-10-31 Gabriel Dos Reis <gdr@integrable-solutions.net> Convert diagnostics to use quoting flag q 9/n diff --git a/gcc/cp/search.c b/gcc/cp/search.c index 68a42f2..9e6178e 100644 --- a/gcc/cp/search.c +++ b/gcc/cp/search.c @@ -1830,6 +1830,12 @@ check_final_overrider (tree overrider, tree basefn) over_return = non_reference (TREE_TYPE (over_type)); if (CLASS_TYPE_P (over_return)) fail = 2; + else + { + cp_warning_at ("deprecated covariant return type for %q#D", + overrider); + cp_warning_at (" overriding %q#D", basefn); + } } else fail = 2; |