This is an archive of the discontinued LLVM Phabricator instance.

[libTooling] Improve error message from failure in selection Stencil
ClosedPublic

Authored by ymandel on Jun 26 2020, 6:05 AM.

Details

Summary

This patch improves the error message provided by the stencil that handles
source from a range selector.

Diff Detail

Event Timeline

ymandel created this revision.Jun 26 2020, 6:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 26 2020, 6:05 AM
gribozavr2 accepted this revision.Jun 26 2020, 6:39 AM

Any chance for a test?

clang/lib/Tooling/Transformer/Stencil.cpp
244

must be carry => must carry

This revision is now accepted and ready to land.Jun 26 2020, 6:39 AM

Any chance for a test?

StencilTest.CatOfInvalidRangeFails essentially covers this (indeed, earlier versions of the code failed this test).
https://github.com/llvm/llvm-project/blob/master/clang/unittests/Tooling/StencilTest.cpp#L419
I can make it more specific, but since this only affects the error message and not the control flow, I didn't update the test. Let me know if you disagree -- I generally avoid testing error message content in tests, but I know there's a variety of opinions on this subject...

I generally avoid testing error message content in tests, but I know there's a variety of opinions on this subject...

If you thought that the quality of the error message matters enough to improve it, then it is worth testing the message, I think.

This revision was automatically updated to reflect the committed changes.