File tree 1 file changed +4
-4
lines changed
clang/include/clang/Basic
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -421,13 +421,12 @@ def CXX11WarnSuggestOverride : DiagGroup<"suggest-override">;
421
421
def WarnUnnecessaryVirtualSpecifier : DiagGroup<"unnecessary-virtual-specifier"> {
422
422
code Documentation = [{
423
423
Warns when a ``final`` class contains a virtual method (including virtual
424
- destructors). Since ``final`` classes cannot be subclassed, their methods
425
- cannot be overridden, and hence the ``virtual`` specifier is useless.
424
+ destructors) that does not override anything. Since ``final`` classes cannot
425
+ be subclassed, their methods cannot be overridden, so there is no point to
426
+ introducing new ``virtual`` methods.
426
427
427
428
The warning also detects virtual methods in classes whose destructor is
428
429
``final``, for the same reason.
429
-
430
- The warning does not fire on virtual methods which are also marked ``override``.
431
430
}];
432
431
}
433
432
@@ -1163,6 +1162,7 @@ def Extra : DiagGroup<"extra", [
1163
1162
FUseLdPath,
1164
1163
CastFunctionTypeMismatch,
1165
1164
InitStringTooLongMissingNonString,
1165
+ WarnUnnecessaryVirtualSpecifier,
1166
1166
]>;
1167
1167
1168
1168
def Most : DiagGroup<"most", [
You can’t perform that action at this time.
0 commit comments