OSDN Git Service

cp:
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 1 Nov 2004 18:24:33 +0000 (18:24 +0000)
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 1 Nov 2004 18:24:33 +0000 (18:24 +0000)
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@89946 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/cp/ChangeLog
gcc/cp/search.c
gcc/doc/extend.texi
gcc/testsuite/ChangeLog
gcc/testsuite/g++.old-deja/g++.mike/p811.C

index bfae47a..067be29 100644 (file)
@@ -1,3 +1,9 @@
+2004-11-01  Nathan Sidwell  <nathan@codesourcery.com>
+
+       PR c++/18064
+       * doc/extend.texi (Deprecated Features): Deprecate G++ covariant
+       extension.
+
 2004-10-16  Daniel Berlin  <dberlin@dberlin.org>
 
        Fix PR tree-optimization/17672
index bea717b..022148e 100644 (file)
@@ -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
index 68a42f2..9e6178e 100644 (file)
@@ -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;
index 45653b1..a4cbb2f 100644 (file)
@@ -9711,6 +9711,11 @@ parameters, as C++ demands.  This feature has been removed, except where
 it is required for backwards compatibility @xref{Backwards Compatibility}.
 @end table
 
+G++ allows a virtual function returning @samp{void *} to be overridden
+by one returning a different pointer type.  This extension to the
+covariant return type rules is now deprecated and will be removed from a
+future version.
+
 The named return value extension has been deprecated, and is now
 removed from G++.
 
index 994723e..3b08af5 100644 (file)
@@ -1,3 +1,8 @@
+2004-11-01  Nathan Sidwell  <nathan@codesourcery.com>
+
+       PR c++/18064
+       * g++.old-deja/g++.mike/p811.C: Avoid covariant extension.
+
 2004-10-31  Mark Mitchell  <mark@codesourcery.com>
 
        PR c++/15172
index 7d15e9e..260c645 100644 (file)
@@ -511,14 +511,14 @@ inline istream& WS(istream& str) { return ws(str); }
 class Y {
 public:
     Y() {}
-    virtual const char *stringify() = 0;
+  virtual const char *stringify() = 0;
     virtual char *stringify2() const = 0; // { dg-error "overriding" } 
 };
 
 class X: public Y {
 public:
     X(): Y() {}
-    char *stringify();         // { dg-error "candidate" }
+    const char *stringify();           // { dg-error "candidate" }
     const char *stringify2() const;  // { dg-error "candidate|conflicting return type" }
 };