public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Ranger: Mark a few classes as final
@ 2024-06-22 14:25 Andrew Pinski
  0 siblings, 0 replies; only message in thread
From: Andrew Pinski @ 2024-06-22 14:25 UTC (permalink / raw)
  To: gcc-patches; +Cc: Andrew Pinski

I noticed there was a warning from clang about int_range's
dtor being marked as final saying the class cannot be inherited from.
So let's mark the few ranger classes as final for those which we know
will be final.

Bootstrapped and tested on x86_64-linux-gnu.

gcc/ChangeLog:

	* value-range.h (class int_range): Mark as final.
	(class prange): Likewise.
	(class frange): Likewise.

Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
---
 gcc/value-range.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/value-range.h b/gcc/value-range.h
index 4a8d69f3408..334ea1bc338 100644
--- a/gcc/value-range.h
+++ b/gcc/value-range.h
@@ -363,7 +363,7 @@ protected:
 // HARD_MAX_RANGES.  This new storage is freed upon destruction.
 
 template<unsigned N, bool RESIZABLE = false>
-class int_range : public irange
+class int_range final : public irange
 {
 public:
   int_range ();
@@ -380,7 +380,7 @@ private:
   wide_int m_ranges[N*2];
 };
 
-class prange : public vrange
+class prange final : public vrange
 {
   friend class prange_storage;
   friend class vrange_printer;
@@ -523,7 +523,7 @@ nan_state::neg_p () const
 // The representation is a type with a couple of endpoints, unioned
 // with the set of { -NAN, +Nan }.
 
-class frange : public vrange
+class frange final : public vrange
 {
   friend class frange_storage;
   friend class vrange_printer;
-- 
2.43.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-06-22 14:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-22 14:25 [PATCH] Ranger: Mark a few classes as final Andrew Pinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).