There is no need to use the ``++final++`` specifier inside a ``++final++`` class. Everything in it is ``++final++`` by default.


Similarly, there is no need to use the ``++final++`` specifier for ``++union++``, because ``++union++``s can neither extend other classes nor be extended.

== Noncompliant Code Example

----
class Base {
  virtual void fun();
};

class Derived final : Base {
  void fun() final;  // Noncompliant
};

union MyUnion final { // Noncompliant
  // ...
};
----

== Compliant Solution

----
class Base {
  virtual void fun();
};

class Derived final : Base {
  void fun() override;
};

union MyUnion {
  // ...
};
----

ifdef::env-github,rspecator-view[]
'''
== Comments And Links
(visible only on this page)

include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]
