summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaLookup.cpp
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2019-10-03 11:22:48 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2019-10-03 11:22:48 +0000
commit1cd399c915a746b0426a8a094906fb5f2a6cea12 (patch)
tree2519659e9f589d3ac6bf1914046d2e7d689e1f43 /clang/lib/Sema/SemaLookup.cpp
parent44bc1186e4bdb54f7f15dea8e85d9e83827bd0d0 (diff)
downloadbcm5719-llvm-1cd399c915a746b0426a8a094906fb5f2a6cea12.tar.gz
bcm5719-llvm-1cd399c915a746b0426a8a094906fb5f2a6cea12.zip
Silence static analyzer getAs<RecordType> null dereference warnings. NFCI.
The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<RecordType> directly and if not assert will fire for us. llvm-svn: 373584
Diffstat (limited to 'clang/lib/Sema/SemaLookup.cpp')
-rw-r--r--clang/lib/Sema/SemaLookup.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp
index fdb8f488471..a098450f5cd 100644
--- a/clang/lib/Sema/SemaLookup.cpp
+++ b/clang/lib/Sema/SemaLookup.cpp
@@ -2130,7 +2130,7 @@ static bool LookupQualifiedNameInUsingDirectives(Sema &S, LookupResult &R,
/// Callback that looks for any member of a class with the given name.
static bool LookupAnyMember(const CXXBaseSpecifier *Specifier,
CXXBasePath &Path, DeclarationName Name) {
- RecordDecl *BaseRecord = Specifier->getType()->getAs<RecordType>()->getDecl();
+ RecordDecl *BaseRecord = Specifier->getType()->castAs<RecordType>()->getDecl();
Path.Decls = BaseRecord->lookup(Name);
return !Path.Decls.empty();
OpenPOWER on IntegriCloud