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/search.c | |
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/search.c')
-rw-r--r-- | gcc/cp/search.c | 6 |
1 files changed, 6 insertions, 0 deletions
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; |