From c95d1dd7f5ec48e4c6d622b57843aaa25528170b Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Wed, 22 Apr 2020 18:02:38 +0100 Subject: [PATCH] c++: Fix misuse of "override" in -Weffc++ warnings (PR 94698) 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 | 6 ++++++ gcc/cp/class.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index cce017cf245..b298db46714 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2020-04-22 Jonathan Wakely + + PR translation/94698 + * class.c (check_field_decls): Change "override" to "define" in + -Weffc++ diagnostics. + 2020-04-22 Iain Sandoe PR c++/94682 diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 41f52e5a5a0..6e14cd37aa4 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -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 %", t); } else if (! TYPE_HAS_COPY_ASSIGN (t)) warning (OPT_Weffc__, - " but does not override %", t); + " but does not define %", t); inform (DECL_SOURCE_LOCATION (pointer_member), "pointer member %q+D declared here", pointer_member); } -- 2.30.2