diff options
author | Alexander Kornienko <alexfh@google.com> | 2015-04-11 02:00:23 +0000 |
---|---|---|
committer | Alexander Kornienko <alexfh@google.com> | 2015-04-11 02:00:23 +0000 |
commit | dfa4cf312655e1a82a39b0ef94e2a4db731aedad (patch) | |
tree | 380384533a5cedc86ff5bf81b7cc334777369102 /unittests/Sema | |
parent | 7d191b2364ab007773cdb792dbd64d1f92158618 (diff) |
Use 'override/final' instead of 'virtual' for overridden methods
Summary:
The patch is generated using clang-tidy misc-use-override check.
This command was used:
tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \
-checks='-*,misc-use-override' -header-filter='llvm|clang' -j=32 -fix
Reviewers: dblaikie
Reviewed By: dblaikie
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D8926
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234678 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Sema')
-rw-r--r-- | unittests/Sema/ExternalSemaSourceTest.cpp | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/unittests/Sema/ExternalSemaSourceTest.cpp b/unittests/Sema/ExternalSemaSourceTest.cpp index 3a93fc77fb..703e97b4ac 100644 --- a/unittests/Sema/ExternalSemaSourceTest.cpp +++ b/unittests/Sema/ExternalSemaSourceTest.cpp @@ -30,7 +30,7 @@ class CompleteTypeDiagnoser : public clang::ExternalSemaSource { public: CompleteTypeDiagnoser(bool MockResult) : CallCount(0), Result(MockResult) {} - virtual bool MaybeDiagnoseMissingCompleteType(SourceLocation L, QualType T) { + bool MaybeDiagnoseMissingCompleteType(SourceLocation L, QualType T) override { ++CallCount; return Result; } @@ -54,8 +54,8 @@ public: ToNS.append("'"); } - virtual void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel, - const Diagnostic &Info) { + void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel, + const Diagnostic &Info) override { if (Chained) Chained->HandleDiagnostic(DiagLevel, Info); if (Info.getID() - 1 == diag::err_using_directive_member_suggest) { @@ -66,13 +66,13 @@ public: } } - virtual void clear() { + void clear() override { DiagnosticConsumer::clear(); if (Chained) Chained->clear(); } - virtual bool IncludeInDiagnosticCounts() const { + bool IncludeInDiagnosticCounts() const override { if (Chained) return Chained->IncludeInDiagnosticCounts(); return false; @@ -97,16 +97,15 @@ public: NamespaceTypoProvider(StringRef From, StringRef To) : CorrectFrom(From), CorrectTo(To), CurrentSema(nullptr), CallCount(0) {} - virtual void InitializeSema(Sema &S) { CurrentSema = &S; } + void InitializeSema(Sema &S) override { CurrentSema = &S; } - virtual void ForgetSema() { CurrentSema = nullptr; } + void ForgetSema() override { CurrentSema = nullptr; } - virtual TypoCorrection CorrectTypo(const DeclarationNameInfo &Typo, - int LookupKind, Scope *S, CXXScopeSpec *SS, - CorrectionCandidateCallback &CCC, - DeclContext *MemberContext, - bool EnteringContext, - const ObjCObjectPointerType *OPT) { + TypoCorrection CorrectTypo(const DeclarationNameInfo &Typo, int LookupKind, + Scope *S, CXXScopeSpec *SS, + CorrectionCandidateCallback &CCC, + DeclContext *MemberContext, bool EnteringContext, + const ObjCObjectPointerType *OPT) override { ++CallCount; if (CurrentSema && Typo.getName().getAsString() == CorrectFrom) { DeclContext *DestContext = nullptr; @@ -140,13 +139,13 @@ class ExternalSemaSourceInstaller : public clang::ASTFrontendAction { std::unique_ptr<DiagnosticConsumer> OwnedClient; protected: - virtual std::unique_ptr<clang::ASTConsumer> + std::unique_ptr<clang::ASTConsumer> CreateASTConsumer(clang::CompilerInstance &Compiler, - llvm::StringRef /* dummy */) { + llvm::StringRef /* dummy */) override { return llvm::make_unique<clang::ASTConsumer>(); } - virtual void ExecuteAction() { + void ExecuteAction() override { CompilerInstance &CI = getCompilerInstance(); ASSERT_FALSE(CI.hasSema()); CI.createSema(getTranslationUnitKind(), nullptr); |