[clang-tools-extra] [clang-tidy] New Option Invalid Enum Default Initialization (PR #159220)

Félix-Antoine Constantin via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 19 08:52:34 PDT 2025


felix642 wrote:

> Would it be better to add the std::errc always to the ignore list? If the user specifies the ignore list and it does not contain std::errc it is missing from the list. I suspect that the warning for std::errc is never needed from this checker.

I think you're right. I wanted to give the user as much control as possible hence why I added an option with `std::errc` as the default value, but I don't see any reason why the user would want to flag valid code. It might also play against them, if they decide to use this option, they might forget to keep the `enum` and the check might start flagging code that is shouldn't.

I think, I'll keep the option, but move the `enum` to be implicitely added to make sure we don't raise false positive.

https://github.com/llvm/llvm-project/pull/159220


More information about the cfe-commits mailing list