[clang-tools-extra] [clang-tidy] Limit modernize-use-constraints to standard enable_if (PR #155237)

DonĂ¡t Nagy via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 25 08:10:03 PDT 2025


NagyDonat wrote:

Oh, I see, that commit was merged on Saturday, while I started to develop this commit (IIRC) on Thursday.

Compared to that change, the only difference provided by my trivial patch is that it silences fixits for `enable_if` implementations that are not standard but take a boolean as the first argument. I still find it a bit strange that this check offers replacement for a custom user-defined template, but I'm not strongly opposed because it's reasonable to assume that if the template is named `enable_if` and its first argument is a boolean, then it should act as `std::enable_if`. (Although the fact that the developer used a custom template instead of the `std::` one suggests that the custom template is different in some sense...)

What do you think about this? Should I just close this ticket or is there any merit in restricting this check to only checking the standard `enable_if`?

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


More information about the cfe-commits mailing list