diff options
author | Haojian Wu <hokein@google.com> | 2016-03-04 08:55:54 +0000 |
---|---|---|
committer | Haojian Wu <hokein@google.com> | 2016-03-04 08:55:54 +0000 |
commit | 678f65a9b4d808fe2f476c43d5acc884927c0377 (patch) | |
tree | c5d1accfdcec9198c3e7742bfb7c6519092bc221 /clang/lib/CodeGen/CodeGenModule.h | |
parent | 22bd871ea66538c1c21929828e2eca2185161c3e (diff) | |
download | bcm5719-llvm-678f65a9b4d808fe2f476c43d5acc884927c0377.tar.gz bcm5719-llvm-678f65a9b4d808fe2f476c43d5acc884927c0377.zip |
[clang-tidy] Make 'modernize-use-nullptr' check work on multiple nested implicit cast expressions.
Summary:
For some test cases like:
```
int func(int, void*, void*);
(double)func(0, 0, 0);
```
The AST contains several `ImplicitCastExpr`s, so we should not only check on the first sub expression.
```
`-CStyleCastExpr 0x7fe43a088938 <line:6:3, col:24> 'double' <NoOp>
`-ImplicitCastExpr 0x7fe43a088920 <col:11, col:24> 'double' <IntegralToFloating>
`-CallExpr 0x7fe43a0888a0 <col:11, col:24> 'int'
|-ImplicitCastExpr 0x7fe43a088888 <col:11> 'int (*)(int, void *, void *)' <FunctionToPointerDecay>
| `-DeclRefExpr 0x7fe43a0887d8 <col:11> 'int (int, void *, void *)' lvalue Function 0x7fe43a0886f0 'func1' 'int (int, void *, void *)'
|-IntegerLiteral 0x7fe43a088800 <col:17> 'int' 0
|-ImplicitCastExpr 0x7fe43a0888e0 <col:20> 'void *' <NullToPointer>
| `-IntegerLiteral 0x7fe43a088820 <col:20> 'int' 0
`-ImplicitCastExpr 0x7fe43a0888f8 <col:23> 'void *' <NullToPointer>
`-IntegerLiteral 0x7fe43a088840 <col:23> 'int' 0
```
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D17849
llvm-svn: 262698
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
0 files changed, 0 insertions, 0 deletions