[pushed] VR: mitigate -Wfinal-dtor-non-final-class clang warnings

Message ID 9ceb4ece-8fba-e9b8-1c97-2e26a0670bbf@suse.cz
State Committed
Commit 8699a0eb620ad076ed377c6652d1326a47235721
Headers
Series [pushed] VR: mitigate -Wfinal-dtor-non-final-class clang warnings |

Commit Message

Martin Liška Aug. 16, 2022, 9:30 a.m. UTC
  Pushed as obvious.

Martin

Fixes:

gcc/value-range-storage.h:129:40: warning: class with destructor marked 'final' cannot be inherited from [-Wfinal-dtor-non-final-class]
gcc/value-range-storage.h:146:36: warning: class with destructor marked 'final' cannot be inherited from [-Wfinal-dtor-non-final-class]

gcc/ChangeLog:

	* value-range-storage.h (class obstack_vrange_allocator): Mark
	  the class as final.
	(class ggc_vrange_allocator): Likewise.
---
 gcc/value-range-storage.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Patch

diff --git a/gcc/value-range-storage.h b/gcc/value-range-storage.h
index 3fac5ea2f86..9cd6b9f7bec 100644
--- a/gcc/value-range-storage.h
+++ b/gcc/value-range-storage.h
@@ -119,7 +119,7 @@  class GTY (()) frange_storage_slot
   frange_props m_props;
 };
 
-class obstack_vrange_allocator : public vrange_allocator
+class obstack_vrange_allocator final: public vrange_allocator
 {
 public:
   obstack_vrange_allocator ()
@@ -139,7 +139,7 @@  private:
   obstack m_obstack;
 };
 
-class ggc_vrange_allocator : public vrange_allocator
+class ggc_vrange_allocator final: public vrange_allocator
 {
 public:
   ggc_vrange_allocator () { }