[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
Wed Aug 27 04:53:29 PDT 2025


NagyDonat wrote:

> AFAIK, the check now will not crash if `enable_if` with incorrect signature is encountered.
> 
>     * If first arg is not `bool` - bail out
> 
>     * If parameter count is not 1 or to - bail out
> 
>     * If 2nd arg is incorrect - do not warn (As I understand from the tests.. maybe wrong) @localspook do you have more insights?
> 
> 
> So we essentially eliminated all "bad" cases from the check. So I'm a little in favor of keeping as is, but it's not strong opinion since it's a very niche case (considering the bug is already fixed)

Ok, then I'm closing this ticket. I agree that this is a very niche question, and I don't see any remaining chances for crashes.

> Could you confirm that bug in https://github.com/Neargye/magic_enum/ is fixed in trunk?

The crash was caused by an `enable_if` variant where the first argument is a type (instead of `bool`), so I'm confident that this crash is fixed in trunk. (I cannot easily perform an experimental confirmation, but I don't think that it's needed.)



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


More information about the cfe-commits mailing list