diff options
| author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-10-16 10:38:40 +0000 |
|---|---|---|
| committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-10-16 10:38:40 +0000 |
| commit | cebfddc0b589037909e12308ccf8dde6a2c167f2 (patch) | |
| tree | 8ab90647b84656978b90f69c760b8c0011c8fe62 /clang/lib | |
| parent | 729a2f6c2bd8a4f2254e3f8a93e8e0c5120ebd35 (diff) | |
| download | bcm5719-llvm-cebfddc0b589037909e12308ccf8dde6a2c167f2.tar.gz bcm5719-llvm-cebfddc0b589037909e12308ccf8dde6a2c167f2.zip | |
CGExprConstant - silence static analyzer getAs<> null dereference warning. NFCI.
The static analyzer is warning about a potential null dereference, but in these cases we should be able to use castAs<> directly and if not assert will fire for us.
llvm-svn: 374988
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/CodeGen/CGExprConstant.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGExprConstant.cpp b/clang/lib/CodeGen/CGExprConstant.cpp index 03ef4ab1842..96e8c9c0d0e 100644 --- a/clang/lib/CodeGen/CGExprConstant.cpp +++ b/clang/lib/CodeGen/CGExprConstant.cpp @@ -1269,8 +1269,8 @@ public: return nullptr; // FIXME: We should not have to call getBaseElementType here. - const RecordType *RT = - CGM.getContext().getBaseElementType(Ty)->getAs<RecordType>(); + const auto *RT = + CGM.getContext().getBaseElementType(Ty)->castAs<RecordType>(); const CXXRecordDecl *RD = cast<CXXRecordDecl>(RT->getDecl()); // If the class doesn't have a trivial destructor, we can't emit it as a |

