This check finds the usages of non-transparent functors and suggest to use the transparent ones.
Details
Diff Detail
Event Timeline
clang-tidy/modernize/UseTransparentFunctorsCheck.cpp | ||
---|---|---|
27 | Should we make this a configurable list that users can add to? | |
62 | This diagnostic is too terse; anyone that is unaware of what a transparent functor is will likely be stumped by it, especially since there is no fixit. Since this is the case where we cannot be sure that a transparent functor is the correct solution, should this be enabled via an option (default on)? | |
94 | This diagnostic could stand to be less terse as well, IMO. The fixit helps though. | |
docs/clang-tidy/checks/modernize-use-transparent-functors.rst | ||
7 | Using transparent functors the -> When using transparent functors, the |
- Fixed the performance problems.
- Altered the diagnostic text.
- Documentation improvements.
- Added an option to silence some warnings.
- Updated to latest trunk.
clang-tidy/modernize/UseTransparentFunctorsCheck.cpp | ||
---|---|---|
27 | I am not sure how frequent is that somebody would like to add some types to this list, but it can be added in a follow up patch. | |
62 | I also extended the error message to refer to the alternative name (diamond operators) as well. I did add an option but I am not happy with the name of the option. Do you have a suggestion? |
clang-tidy/modernize/UseTransparentFunctorsCheck.cpp | ||
---|---|---|
71 | The message would be much better if you would put the name of this functor, like | |
90–110 | This can be moved to one or 2 functions, returning FunctorTypeLoc or llvm::Optional<TemplateSpecializationTypeLoc> | |
docs/clang-tidy/checks/modernize-use-transparent-functors.rst | ||
33–34 | I think | |
34 | Add a note |
docs/clang-tidy/checks/modernize-use-transparent-functors.rst | ||
---|---|---|
13 | Say somewhere that you also handle cases like |
clang-tidy/modernize/UseTransparentFunctorsCheck.cpp | ||
---|---|---|
90 | It does not compile without it. It looks like the << is not overloaded for Twine. |
clang-tidy/modernize/UseTransparentFunctorsCheck.cpp | ||
---|---|---|
90 | I learn something new every day. ;-) | |
docs/clang-tidy/checks/modernize-use-transparent-functors.rst | ||
8 | It not possible -> It is not possible | |
35–37 | The way I read this, it seems to be claiming that if you set SafeMode to nonzero, the check never warns. How about: If the option is set to non-zero, the check will not diagnose cases where using a transparent functor cannot be guaranteed to produce identical results as the original code. The default value for this option is `0`. |
Should we make this a configurable list that users can add to?