[PATCH] D51192: Fix reported range of partial token replacement

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 6 12:09:49 PDT 2018


aaron.ballman added a comment.

In https://reviews.llvm.org/D51192#1226257, @steveire wrote:

> How? This is 'private' code. I don't think it's worth changing that or creating a test with a huge amount of infrastructure in order to test this indirectly.


This is changing the observable behavior of the tool, so it should have tests unless they're impossible to write.

> Am I missing something?

I'd probably pipe the diagnostic output to a temporary file that gets FileChecked with strict whitespace to see if the underlines from the diagnostic match the expected locations. We do this in a few Clang tests, like SemaCXX\struct-class-redecl.cpp or Misc\wrong-encoding.c.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D51192





More information about the cfe-commits mailing list