From a45928cdebcf37de2605e4f58509a37542dd9eba Mon Sep 17 00:00:00 2001 From: Matthias Maennich Date: Tue, 19 Sep 2017 16:00:21 +0200 Subject: Fix some occurrences of missing override keywords Fix issues diagnosed by clang-tidy [modernize-use-override]. These occurrences are only showing up on OSX. Signed-off-by: Matthias Maennich --- Source/cmGlobalXCodeGenerator.cxx | 9 ++++++--- Source/cmLocalXCodeGenerator.h | 16 ++++++++-------- Source/cmMachO.cxx | 2 +- Source/cmXCode21Object.h | 2 +- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index a1bec6b..29b06c3 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -47,8 +47,11 @@ public: : Version("1.5") { } - void StartElement(const std::string&, const char**) { this->Data = ""; } - void EndElement(const std::string& name) + void StartElement(const std::string&, const char**) override + { + this->Data = ""; + } + void EndElement(const std::string& name) override { if (name == "key") { this->Key = this->Data; @@ -58,7 +61,7 @@ public: } } } - void CharacterDataHandler(const char* data, int length) + void CharacterDataHandler(const char* data, int length) override { this->Data.append(data, length); } diff --git a/Source/cmLocalXCodeGenerator.h b/Source/cmLocalXCodeGenerator.h index b05eab7..8c9596f 100644 --- a/Source/cmLocalXCodeGenerator.h +++ b/Source/cmLocalXCodeGenerator.h @@ -27,16 +27,16 @@ public: ///! Set cache only and recurse to false by default. cmLocalXCodeGenerator(cmGlobalGenerator* gg, cmMakefile* mf); - virtual ~cmLocalXCodeGenerator(); - virtual std::string GetTargetDirectory( - cmGeneratorTarget const* target) const; - virtual void AppendFlagEscape(std::string& flags, - const std::string& rawFlag); - virtual void Generate(); + ~cmLocalXCodeGenerator() override; + std::string GetTargetDirectory( + cmGeneratorTarget const* target) const override; + void AppendFlagEscape(std::string& flags, + const std::string& rawFlag) override; + void Generate() override; virtual void GenerateInstallRules(); - virtual void ComputeObjectFilenames( + void ComputeObjectFilenames( std::map& mapping, - cmGeneratorTarget const* gt = nullptr); + cmGeneratorTarget const* gt = nullptr) override; private: }; diff --git a/Source/cmMachO.cxx b/Source/cmMachO.cxx index 3706dd3..8002175 100644 --- a/Source/cmMachO.cxx +++ b/Source/cmMachO.cxx @@ -134,7 +134,7 @@ public: : cmMachOHeaderAndLoadCommands(_swap) { } - bool read_mach_o(cmsys::ifstream& fin) + bool read_mach_o(cmsys::ifstream& fin) override { if (!read(fin, this->Header)) { return false; diff --git a/Source/cmXCode21Object.h b/Source/cmXCode21Object.h index bcd8d93..8e4b80f 100644 --- a/Source/cmXCode21Object.h +++ b/Source/cmXCode21Object.h @@ -14,7 +14,7 @@ class cmXCode21Object : public cmXCodeObject { public: cmXCode21Object(PBXType ptype, Type type); - virtual void PrintComment(std::ostream&); + void PrintComment(std::ostream&) override; static void PrintList(std::vector const&, std::ostream& out, PBXType t); static void PrintList(std::vector const&, std::ostream& out); -- cgit v0.12