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 | ||
---|---|---|
93 | Please don't use auto when type is not spelled in same statement or iterator. | |
100 | Please don't use auto when type is not spelled in same statement or iterator. | |
115 | Please don't use auto when type is not spelled in same statement or iterator. | |
129 | Please don't use auto when type is not spelled in same statement or iterator. | |
218 | Should it check for C++17 or newer? | |
253 | Please don't use auto when type is not spelled in same statement or iterator. | |
259 | Please don't use auto when type is not spelled in same statement or iterator. | |
280 | Please don't use auto when type is not spelled in same statement or iterator. | |
clang-tools-extra/docs/ReleaseNotes.rst | ||
133 | Please put in new checks list in alphabetical order. |
clang-tools-extra/clang-tidy/modernize/DeprecatedIteratorBaseCheck.cpp | ||
---|---|---|
218 | 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.
Please don't use auto when type is not spelled in same statement or iterator.