[PATCH] D64671: [clang-tidy] New check: misc-init-local-variables

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 27 11:43:55 PDT 2019


aaron.ballman added a comment.

In D64671#1644280 <https://reviews.llvm.org/D64671#1644280>, @jpakkane wrote:

> I used stdint to replicate a real world use case as I'd imagine those types would match this search quite heavily.


The problem is that this uses the system header search paths and so the testing system has no control over *what* is found from bot to bot. That is why we structure almost all of our tests to not use system includes.

> The tests already have one test for a typedeffed integer and one that is defined with a macro. If those are deemed sufficient, the stdint type can be removed altogether. If the stdint types are defined via some other mechanism such as compiler intrinsics, there would be no test for that. I do not know if that is the case with current libcs.

I don't see a need for int32_t specifically in this test.

> I can update the MR as requested once someone with enough stripes makes the policy decision.

I'm not certain that we've written this instruction down so much as let new contributors know when they stumble into it. It would probably be a good idea for us to get some testing documentation written down at some point. Despite that, our policy has been to not use `#include` in test cases unless the included file is relative to the test.


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

https://reviews.llvm.org/D64671





More information about the cfe-commits mailing list