kbobyrev added inline comments.
================
Comment at: clang-tools-extra/clangd/unittests/IncludeCleanerTests.cpp:170
 
+TEST(IncludeCleaner, ScratchBuffer) {
+  TestTU TU;
----------------
sammccall wrote:
> this doesn't seem to test very much, a comment should indicate that this is 
> guarding against a crash.
> 
> Ideally we'd (also?) have a test that calls findReferencedFiles and actually 
> assert which IDs we get, rather than run some big blob of code and hope not 
> to crash.
Good point, I just ran into this for D111711:

foo.h
```
void foo();
```

foo.cpp
```
void foo() {}
```

`computeUnusedIncludes()` does not return `foo.h` but it wasn't processed (e.g. 
its ID was never in the `ReferencedFiles` in the first place) :(


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D111698/new/

https://reviews.llvm.org/D111698

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to