This is an archive of the discontinued LLVM Phabricator instance.

Fix cppcoreguidelines-pro-bounds-pointer-arithmetic not working for functions with auto return specifier.
AbandonedPublic

Authored by predator5047 on Feb 25 2018, 9:03 AM.

Details

Summary

Fix bug #36489

Diff Detail

Event Timeline

predator5047 created this revision.Feb 25 2018, 9:03 AM
alexfh added a reviewer: mgehre.

Some minor formatting nits, but otherwise LGTM. You should run the patch through clang-format: https://clang.llvm.org/docs/ClangFormat.html#script-for-patch-reformatting

clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.cpp
29

This extends past the 80-col limit.

test/clang-tidy/cppcoreguidelines-pro-bounds-pointer-arithmetic.cpp
12

Should be int * instead of int* (elsewhere as well).

26

Can you remove the whitespace alignment from the new tests?

Does it also work with lambdas (being implicitly auto) that return pointers? A test case for that would be nice.

mgehre requested changes to this revision.May 13 2019, 12:22 PM
This revision now requires changes to proceed.May 13 2019, 12:22 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 13 2019, 12:22 PM
predator5047 abandoned this revision.Jul 18 2021, 9:56 AM