-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Open
Add option to readability-implicit-bool-conversion check to allow implicit conversion *to bool*#36323
Feature
Copy link
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillaclang-tidyenhancementImproving things as opposed to bug fixing, e.g. new or missing featureImproving things as opposed to bug fixing, e.g. new or missing featuregood first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contribute
Description
Bugzilla Link | 36975 |
Version | unspecified |
OS | All |
Reporter | LLVM Bugzilla Contributor |
Extended Description
From the readability-implicit-bool-conversion check, I'd like to take advantage of these parts:
- boolean expression/literal to integer,
- boolean expression/literal to floating.
But not these:
- integer expression/literal to boolean,
- floating expression/literal to boolean,
- pointer/pointer to member/nullptr/NULL to boolean,
Seems like an AllowConversionsToBool
option would take care of this. Maybe for completeness/symmetry also a AllowConversionsFromBool
option. Both defaulting to 0.
Metadata
Metadata
Assignees
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillaclang-tidyenhancementImproving things as opposed to bug fixing, e.g. new or missing featureImproving things as opposed to bug fixing, e.g. new or missing featuregood first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contribute