From 1cd399c915a746b0426a8a094906fb5f2a6cea12 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Thu, 3 Oct 2019 11:22:48 +0000 Subject: Silence static analyzer getAs null dereference warnings. NFCI. The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs directly and if not assert will fire for us. llvm-svn: 373584 --- clang/lib/Sema/SemaLookup.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/Sema/SemaLookup.cpp') 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()->getDecl(); + RecordDecl *BaseRecord = Specifier->getType()->castAs()->getDecl(); Path.Decls = BaseRecord->lookup(Name); return !Path.Decls.empty(); -- cgit v1.2.3