c++: Fix misuse of "override" in -Weffc++ warnings (PR 94698)
authorJonathan Wakely <jwakely@redhat.com>
Wed, 22 Apr 2020 17:02:38 +0000 (18:02 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Wed, 22 Apr 2020 17:02:38 +0000 (18:02 +0100)
These warnings have nothing to do with virtual functions, so "override"
is inappropriate. The warnings are just talking about defining special
members, so let's say that.

PR translation/94698
* class.c (check_field_decls): Change "override" to "define" in
-Weffc++ diagnostics.

gcc/cp/ChangeLog
gcc/cp/class.c

index cce017cf245e9803a42b61f6d1014811415ce1f6..b298db46714afa77ab472fd1e30055e77e72cf01 100644 (file)
@@ -1,3 +1,9 @@
+2020-04-22  Jonathan Wakely  <jwakely@redhat.com>
+
+       PR translation/94698
+       * class.c (check_field_decls): Change "override" to "define" in
+       -Weffc++ diagnostics.
+
 2020-04-22 Iain Sandoe <iain@sandoe.co.uk>
 
        PR c++/94682
index 41f52e5a5a0e3413166f741377808f284d13052a..6e14cd37aa4954848c657bf42d607e2df524e319 100644 (file)
@@ -3838,13 +3838,13 @@ check_field_decls (tree t, tree *access_decls,
          if (! TYPE_HAS_COPY_CTOR (t))
            {
              warning (OPT_Weffc__,
-                      "  but does not override %<%T(const %T&)%>", t, t);
+                      "  but does not define %<%T(const %T&)%>", t, t);
              if (!TYPE_HAS_COPY_ASSIGN (t))
                warning (OPT_Weffc__, "  or %<operator=(const %T&)%>", t);
            }
          else if (! TYPE_HAS_COPY_ASSIGN (t))
            warning (OPT_Weffc__,
-                    "  but does not override %<operator=(const %T&)%>", t);
+                    "  but does not define %<operator=(const %T&)%>", t);
          inform (DECL_SOURCE_LOCATION (pointer_member),
                  "pointer member %q+D declared here", pointer_member);
        }