This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Fix an assert failure in `modernize-loop-convert`.
ClosedPublic

Authored by hokein on Feb 16 2016, 1:16 AM.

Details

Summary

The test code will trigger following an assert failure:

assert.h assertion failed at LoopConvertUtils.cpp:560 in
bool clang::tidy::modernize::ForLoopIndexUseVisitor::TraverseMemberExpr(clang::MemberExpr*): ExprType->isPointerType() && "Operator-> returned non-pointer type"

Diff Detail

Repository
rL LLVM

Event Timeline

hokein updated this revision to Diff 48050.Feb 16 2016, 1:16 AM
hokein retitled this revision from to [clang-tidy] Fix an assert failure in `modernize-loop-convert`..
hokein updated this object.
alexfh accepted this revision.Feb 16 2016, 2:02 AM
alexfh edited edge metadata.

LG with one nit (see inline comments).

test/clang-tidy/modernize-loop-convert-assert-failure.cpp
3 ↗(On Diff #48050)

I suppose, this is output of creduce? Can you run creduce again with --sanitize? Thanks!

This revision is now accepted and ready to land.Feb 16 2016, 2:02 AM
hokein updated this revision to Diff 48056.Feb 16 2016, 2:25 AM
hokein edited edge metadata.

Minize testcase.

hokein marked an inline comment as done.Feb 16 2016, 2:26 AM
hokein added inline comments.
test/clang-tidy/modernize-loop-convert-assert-failure.cpp
4 ↗(On Diff #48056)

Done with --sanitize. This is the output of creduce.

This revision was automatically updated to reflect the committed changes.
hokein marked an inline comment as done.