This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] misc-use-after-move: Fix failing assertion
ClosedPublic

Authored by mboehme on Mar 3 2017, 5:03 AM.

Details

Summary

I've added a test case that (without the fix) triggers the assertion,
which happens when a move happens in an implicitly called conversion
operator.

Diff Detail

Repository
rL LLVM

Event Timeline

mboehme created this revision.Mar 3 2017, 5:03 AM
mboehme added inline comments.Mar 3 2017, 5:06 AM
test/clang-tidy/misc-use-after-move.cpp
285 ↗(On Diff #90462)

I've seen this column number flapping back and forth between 6 and 7 before.

This seems to be unrelated to my fix and instead is triggered simply by adding the extra test case below; even with my fix present, this reverts back to 7 if I remove the test case. Looks like an obscure bug in the way the column number is computed...

mboehme marked an inline comment as done.Mar 3 2017, 5:07 AM
mboehme added inline comments.
test/clang-tidy/misc-use-after-move.cpp
285 ↗(On Diff #90462)

Should be "reverts back to 6"

alexfh accepted this revision.Mar 3 2017, 5:27 AM

LG. Thanks!

test/clang-tidy/misc-use-after-move.cpp
285 ↗(On Diff #90462)

Interesting. Are you sure there's nothing else here in play? Like non-ascii characters or weird line endings?

This revision is now accepted and ready to land.Mar 3 2017, 5:27 AM
mboehme marked an inline comment as done.Mar 3 2017, 5:57 AM
mboehme added inline comments.
test/clang-tidy/misc-use-after-move.cpp
285 ↗(On Diff #90462)

I just checked -- nothing I can find. The file doesn't contain any bytes with the high bit set, and there aren't any '\r' either.

alexfh added inline comments.Mar 3 2017, 6:08 AM
test/clang-tidy/misc-use-after-move.cpp
285 ↗(On Diff #90462)

Anyway, the patch LG. We can take a look at the column glitch offline.

This revision was automatically updated to reflect the committed changes.