Add a new clang-tidy module for safety-critical checks.
Include a check which finds instances of vector<bool> which is banned by 'High Integrity C++'.
Differential D29118
[clang-tidy] safety-no-vector-bool jbcoe on Jan 25 2017, 1:27 AM. Authored by
Details Add a new clang-tidy module for safety-critical checks. Include a check which finds instances of vector<bool> which is banned by 'High Integrity C++'.
Diff Detail Event Timeline
Comment Actions Please mention new checks group in docs/clang-tidy/index.rst (in alphabetical order). Please mention this check in docs/ReleaseNotes.rst (see previous releases as example).
Comment Actions Responses to some change requests. Input needed on template argument matcher.
Comment Actions Handling code like std::pair<std::vector<bool>, int> is currently eluding me. If I define std::pair to have members first and second then std::pair<std::vector<bool>, int> triggers the vector<bool> diagnostic but in the template, not the instantiation point. I need to match class definitions that have vector<bool> as a template argument and exclude them from later matchers. I can't see how to do this right now. I suspect some more sophisticated matchers or approaches are needed.
Comment Actions Minor changes in response to review comments. Patch abandoned as approach taken cannot handle templates. Comment Actions Posting a comment re-opened this patch. The approach taken cannot handle templates using std::vector<bool>, a radical rework is needed. https://reviews.llvm.org/D29267 introduces the safety critical module with a much simpler check (no assembler). |
Unnecessary empty line.