aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/class.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/class.c')
-rw-r--r--gcc/cp/class.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 712169c..a47777c 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -2780,7 +2780,9 @@ check_for_override (tree decl, tree ctype)
{
DECL_VINDEX (decl) = decl;
overrides_found = true;
- if (warn_override && !DECL_OVERRIDE_P (decl)
+ if (warn_override
+ && !DECL_OVERRIDE_P (decl)
+ && !DECL_FINAL_P (decl)
&& !DECL_DESTRUCTOR_P (decl))
warning_at (DECL_SOURCE_LOCATION (decl), OPT_Wsuggest_override,
"%qD can be marked override", decl);