diff --git a/CMakeLists.txt b/CMakeLists.txt index f45a805098b..aa6797b600e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -419,6 +419,7 @@ else() # MSVC add_compile_flag("-Wswitch") # we explicitly expect this in the code add_compile_flag("-Wimplicit-fallthrough") add_compile_flag("-Wnon-virtual-dtor") + add_compile_flag("-Wsuggest-override") if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") # Google style requires this, so make sure we compile cleanly with it. diff --git a/src/passes/Outlining.cpp b/src/passes/Outlining.cpp index c52213fdc61..840a84bad37 100644 --- a/src/passes/Outlining.cpp +++ b/src/passes/Outlining.cpp @@ -662,7 +662,7 @@ struct ReconstructStringifyWalker }; struct Outlining : public Pass { - void run(Module* module) { + void run(Module* module) override { HashStringifyWalker stringify; // Walk the module and create a "string representation" of the program. stringify.walkModule(module); diff --git a/src/passes/Poppify.cpp b/src/passes/Poppify.cpp index a7f3e5cccd7..c12c7203c0d 100644 --- a/src/passes/Poppify.cpp +++ b/src/passes/Poppify.cpp @@ -456,7 +456,7 @@ class PoppifyFunctionsPass : public Pass { } // anonymous namespace class PoppifyPass : public Pass { - void run(Module* module) { + void run(Module* module) override { PassRunner subRunner(getPassRunner()); subRunner.add(std::make_unique()); // TODO: Enable this once it handles Poppy blocks correctly