-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Closed
Labels
clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzer
Description
Consider:
struct S final {
virtual void foo();
};
S::foo() doesn't override anything and it cannot be overridden because S is final, so declaring it virtual is wasteful and the compiler could warn about that.
Maybe not as useful but in a similar vein, Clang could warn about members which are known never to be overridden because the class is local to the file, for example:
namespace {
struct S {
virtual void foo() { ... }
};
}
[... no classes derived from S, or at least none that override S::foo() ... ]
Metadata
Metadata
Assignees
Labels
clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzer