[all-commits] [llvm/llvm-project] 274b6b: Only enable -Wsuggest-override if it doesn't sugge...
kepler-5 via All-commits
all-commits at lists.llvm.org
Wed Jul 22 10:06:34 PDT 2020
Branch: refs/heads/master
Home: https://github.com/llvm/llvm-project
Commit: 274b6b0c7a8b584662595762eaeff57d61c6807f
https://github.com/llvm/llvm-project/commit/274b6b0c7a8b584662595762eaeff57d61c6807f
Author: Logan Smith <logan.r.smith0 at gmail.com>
Date: 2020-07-22 (Wed, 22 Jul 2020)
Changed paths:
M llvm/cmake/modules/HandleLLVMOptions.cmake
Log Message:
-----------
Only enable -Wsuggest-override if it doesn't suggest adding override to functions that are already final
A previous patch added -Wsuggest-override using a simple add_flag_if_supported(). This causes lots of warnings in LLVM when building with older GCC versions (< 9.2) which suggest adding override to functions that are only marked final. The current flags in both GCC >=9.2 and Clang accept plain final as equivalent to override final.
This patch adds logic to detect versions of -Wsuggest-override that warn on void foo() final and disables them to avoid warning spam in builds using older GCC's. This has the added minor benefit of getting rid of the useless C_SUPPORTS_SUGGEST_OVERRIDE_FLAG CMake cache variable which was set by add_flag_if_supported().
Differential Revision: https://reviews.llvm.org/D84292
More information about the All-commits
mailing list