[PATCH] D29118: [clang-tidy] safety-no-vector-bool

2017-02-01 Thread Jonathan B Coe via Phabricator via cfe-commits
jbcoe abandoned this revision. jbcoe added a comment. Posting a comment re-opened this patch. The approach taken cannot handle templates using `std::vector`, a radical rework is needed. https://reviews.llvm.org/D29267 introduces the safety critical module with a much simpler check (no assembler

[PATCH] D29118: [clang-tidy] safety-no-vector-bool

2017-01-29 Thread Jonathan B Coe via Phabricator via cfe-commits
jbcoe updated this revision to Diff 86225. jbcoe added a comment. Minor changes in response to review comments. Patch abandoned as approach taken cannot handle templates. https://reviews.llvm.org/D29118 Files: clang-tools-extra/clang-tidy/CMakeLists.txt clang-tools-extra/clang-tidy/safety/

[PATCH] D29118: [clang-tidy] safety-no-vector-bool

2017-01-29 Thread Jonathan B Coe via Phabricator via cfe-commits
jbcoe marked 5 inline comments as done. jbcoe added a comment. Handling code like `std::pair, int>` is currently eluding me. If I define `std::pair` to have members `first` and `second` then `std::pair, int>` triggers the `vector` diagnostic but in the template, not the instantiation point. I

[PATCH] D29118: [clang-tidy] safety-no-vector-bool

2017-01-27 Thread Ben Cox via Phabricator via cfe-commits
djehuti added inline comments. Comment at: clang-tools-extra/clang-tidy/safety/NoVectorBoolCheck.cpp:52 +<< MatchedDecl; + } +} JonasToth wrote: > maybe an safety else with an failing assert, so you can see that unexpected > behaviour, see comment above

[PATCH] D29118: [clang-tidy] safety-no-vector-bool

2017-01-27 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tools-extra/clang-tidy/safety/NoVectorBoolCheck.cpp:50 +diag(MatchedDecl->getLocation(), + " function %0 returns an instance of std::vector") +<< MatchedDecl; jbcoe wrote: > djehuti wrote: > >

[PATCH] D29118: [clang-tidy] safety-no-vector-bool

2017-01-26 Thread Jonathan B Coe via Phabricator via cfe-commits
jbcoe added inline comments. Comment at: clang-tools-extra/clang-tidy/safety/NoVectorBoolCheck.cpp:50 +diag(MatchedDecl->getLocation(), + " function %0 returns an instance of std::vector") +<< MatchedDecl; djehuti wrote: > JonasToth wrote: > >

[PATCH] D29118: [clang-tidy] safety-no-vector-bool

2017-01-26 Thread Jonathan B Coe via Phabricator via cfe-commits
jbcoe updated this revision to Diff 85967. jbcoe marked 2 inline comments as done. jbcoe added a comment. Responses to some change requests. Input needed on template argument matcher. https://reviews.llvm.org/D29118 Files: clang-tools-extra/clang-tidy/CMakeLists.txt clang-tools-extra/clang-