Some thoughts that started in http://reviews.llvm.org/D18919:
Is there any policy about requirements for modernize checks?
" I see that some checks from modernize require C++11 (e.g. modernize-make-unique which is in C++14) and other require just C++ (modernize-loop-convert), and it even has a comment
// Only register the matchers for C++. Because this checker is used for
// modernization, it is reasonable to run it on any C++ standard with the // assumption the user is trying to modernize their codebase. if (!getLangOpts().CPlusPlus) return;
I have 2 thoughts for this:
- there should be note in documentation about it, so the user won’t spend time debuging why the check doesn’t do anything. e.g. “This check requires to compile code with C++11 or higher”
- I would suggest modernize checks to require standard version the same or higher for C++ standars(featchures) that doesn’t break backwards compatibility:
e.g. loop-convert should require C++11, make-shared C++14, modernize-use-using also C++11 (because user can just start using C++11 or C++14 without any problems)
but for modernize-increment-bool, that is deprecated in C++17, it should require just C++ (because if someone need it, the he won’t be able to compile his code with C++17)."
Do you think this idea is good?