[clang-tidy] Extend bugprone-sizeof-expression to check sizeof(pointers to structures)
authorAdam Balogh <adam.balogh@ericsson.com>
Tue, 7 May 2019 06:16:02 +0000 (06:16 +0000)
committerAdam Balogh <adam.balogh@ericsson.com>
Tue, 7 May 2019 06:16:02 +0000 (06:16 +0000)
commitecd1a82ee208be81d168b230bd725fda6ab4eec2
treec89046e65f9d63a6c73c759a640861186b804db5
parent912251e82f09b586712aae0441a9822f5cc37947
[clang-tidy] Extend bugprone-sizeof-expression to check sizeof(pointers to structures)

Accidentally taking the size of a struct-pointer type or a value of this type
is more common than explicitly using the & operator for the value. This patch
extends the check to include these cases.

Differential Revision: https://reviews.llvm.org/D61260

llvm-svn: 360114
clang-tools-extra/clang-tidy/bugprone/SizeofExpressionCheck.cpp
clang-tools-extra/test/clang-tidy/bugprone-sizeof-expression.cpp