This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] fix PR36489 - respect deduced pointer types from auto as well
ClosedPublic

Authored by JonasToth on Jul 23 2018, 10:41 AM.

Details

Summary

The cppcoreguidelines-pro-bounds-pointer-arithmetic warns on all occassion where
pointer arithmetic is used, but does not check values where the pointer types
is deduced via auto. This patch adjusts this behaviour and solved
PR36489.
I accidentally commited a wrong patch, this Differential is meant to have a
correct revision description and code attached to it.
Because the patch was accepted by aaron.ballman already, i will just commit
it.
See https://reviews.llvm.org/D48717 for the old differntial (contains wrong
code from the mixup)

Diff Detail

Event Timeline

JonasToth created this revision.Jul 23 2018, 10:41 AM

rebase to master

This revision was not accepted when it landed; it landed in state Needs Review.Jul 23 2018, 10:46 AM
This revision was automatically updated to reflect the committed changes.