* class.c (check_for_override): Don't warn for final functions.
* g++.dg/warn/Wsuggest-override-2.C: New test.
From-SVN: r271065
+2019-05-10 Marek Polacek <polacek@redhat.com>
+
+ PR c++/78010 - bogus -Wsuggest-override warning on final function.
+ * class.c (check_for_override): Don't warn for final functions.
+
2019-05-10 Jakub Jelinek <jakub@redhat.com>
PR pch/90326
{
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);
+2019-05-10 Marek Polacek <polacek@redhat.com>
+
+ PR c++/78010 - bogus -Wsuggest-override warning on final function.
+ * g++.dg/warn/Wsuggest-override-2.C: New test.
+
2019-05-10 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/90385
--- /dev/null
+// PR c++/78010
+// { dg-options "-std=c++11 -Wsuggest-override" }
+
+struct A {
+ virtual void f();
+};
+struct B : A {
+ void f() final; // { dg-bogus "can be marked override" }
+};