klimek added inline comments. ================ Comment at: clang-tidy/modernize/LoopConvertCheck.cpp:555-564 @@ +554,12 @@ + Descriptor.DerefByValue = true; + // Try to find the type of the elements on the container from the + // usages. We can assume that we have at least one (non-const) Usage, + // because usagesAreConst() returned false. + for (const Usage &U : Usages) { + if (!U.Expression || U.Expression->getType().isNull()) + continue; + QualType Type = U.Expression->getType().getCanonicalType(); + if (U.IsArrow) { + if (!Type->isPointerType()) + continue; + Type = Type->getPointeeType(); ---------------- a) please add a regression test for everything you find during development b) I think the comment that we can assume that we have at least one non-const usage is not helpful any more, as we're not just accessing [0] any more.
http://reviews.llvm.org/D12675 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits