Finds deprecated in C++17 inheritance from std::iterator and replaces it with type aliases. The check itself is not marked as C++17 because it could be applied to any project with no harm.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang-tools-extra/clang-tidy/modernize/DeprecatedIteratorBaseCheck.cpp | ||
---|---|---|
94 | Please don't use auto when type is not spelled in same statement or iterator. | |
101 | Please don't use auto when type is not spelled in same statement or iterator. | |
116 | Please don't use auto when type is not spelled in same statement or iterator. | |
130 | Please don't use auto when type is not spelled in same statement or iterator. | |
219 | Should it check for C++17 or newer? | |
254 | Please don't use auto when type is not spelled in same statement or iterator. | |
260 | Please don't use auto when type is not spelled in same statement or iterator. | |
281 | Please don't use auto when type is not spelled in same statement or iterator. | |
clang-tools-extra/docs/ReleaseNotes.rst | ||
136 | Please put in new checks list in alphabetical order. |
clang-tools-extra/clang-tidy/modernize/DeprecatedIteratorBaseCheck.cpp | ||
---|---|---|
219 | I do not think so. It is a backward compatible change. The standard never required to inherit iterators from the std::iterator, and the standard library itself had not inheriting from std::iterator iterators. |
First of all I'd definitely wait until a patch to include ASTMatcher support for CXXBaseSpecifier lands before progressing with this.
Secondly this issue should be warned on by clang when compiling with c++17 with some stdlib support, libc++ should mark iterator as deprecated when compiling with c++17.
Having said that this still has value as the fix its are helpful.
clang-tidy: warning: 'auto It' can be declared as 'const auto *It' [llvm-qualified-auto]
not useful