Modifies all checks that are language version dependent to use isLanguageVersionSupported
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Looks good, but please move non-mechanical changes (potentially-semantic changes) into a separate patch.
clang-tools-extra/clang-tidy/cert/DefaultOperatorNewAlignmentCheck.h | ||
---|---|---|
33 | I think CPlusPlus17 implies CPlusPlus. | |
clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.h | ||
31 |
If you end up making that change, it would be great if you could also apply it throughout this patch. | |
clang-tools-extra/clang-tidy/misc/UnconventionalAssignOperatorCheck.h | ||
39 | Shouldn't this be a non-11 check? | |
clang-tools-extra/clang-tidy/modernize/DeprecatedIosBaseAliasesCheck.h | ||
33 | Also should be non-11 to preserve existing behavior? | |
clang-tools-extra/clang-tidy/modernize/LoopConvertCheck.h | ||
29 | Ditto, non-11. It seems however that this check indeed wants C++11. If you would like to make that change, please make pull it out into a separate patch. | |
clang-tools-extra/clang-tidy/modernize/ReplaceAutoPtrCheck.h | ||
55 | Ditto, please make semantic changes in a separate patch. | |
clang-tools-extra/clang-tidy/modernize/UseAutoCheck.h | ||
28 | Ditto. | |
clang-tools-extra/clang-tidy/modernize/UseEqualsDefaultCheck.h | ||
47 | Ditto. | |
clang-tools-extra/clang-tidy/modernize/UseEqualsDeleteCheck.h | ||
49 | Ditto. | |
clang-tools-extra/clang-tidy/performance/MoveConstArgCheck.h | ||
37 | Ditto. |
Made another pull request that could neaten this implementation up - https://reviews.llvm.org/D75441, will wait to see how that goes down before getting this pushed.
clang-tools-extra/clang-tidy/cert/DefaultOperatorNewAlignmentCheck.h | ||
---|---|---|
33 | This is saying it needs c++ but not c++17, so c++98->c++14 are Ok but not 17 or 20. Besides this is the current behaviour in the cpp file |
Support for the previous point didnt go too well so will stick with the current implementation
clang-tools-extra/clang-tidy/cert/DefaultOperatorNewAlignmentCheck.h | ||
---|---|---|
33 | Sorry, I misread and didn't notice the exclamation mark. Your edit makes sense to me. I commented because I was comparing with the .cpp file which was not checking CPlusPlus: void DefaultOperatorNewAlignmentCheck::registerMatchers(MatchFinder *Finder) { // Check not applicable in C++17 (or newer). if (getLangOpts().CPlusPlus17) return; So there is a tiny change here: previously, this check was being registered in non-C++ language modes, now it is not. I think your change to only enable in C++ modes is good, but again I think it would be best done in a separate patch. |
I think CPlusPlus17 implies CPlusPlus.