[PATCH] D113201: [clang-tidy] Fix a crash in modernize-loop-convert around conversion operators

Whisperity via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 15 01:57:16 PST 2021


whisperity added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp:155-167
+/// Look through conversion/copy constructors and operators to find the explicit
 /// initialization expression, returning it is found.
 ///
 /// The main idea is that given
 ///   vector<int> v;
 /// we consider either of these initializations
 ///   vector<int>::iterator it = v.begin();
----------------
steakhal wrote:
> I think it's called //conversion member functions//.
Perhaps it would be nice if an example was added to the comment here which involves said conversion.


================
Comment at: clang-tools-extra/test/clang-tidy/checkers/modernize-loop-convert-basic.cpp:278
+  // conversion operator, which has no name, to Q::const_iterator.
+  Q Qt;
+  for (Q::const_iterator It = Qt.begin(), E = Qt.end(); It != E; ++It) {
----------------
This is not specific to //Qt//, the GUI framework, right?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D113201/new/

https://reviews.llvm.org/D113201



More information about the cfe-commits mailing list