diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -1189,7 +1189,7 @@ S.popCodeSynthesisContext(); } }; -} +} // namespace static bool checkTupleLikeDecomposition(Sema &S, ArrayRef Bindings, @@ -4213,7 +4213,7 @@ CXXRecordDecl *ClassDecl; }; -} +} // namespace ValueDecl *Sema::tryLookupCtorInitMemberDecl(CXXRecordDecl *ClassDecl, CXXScopeSpec &SS, @@ -5055,7 +5055,7 @@ return false; } }; -} +} // namespace /// Determine whether the given type is an incomplete or zero-lenfgth /// array type. @@ -5994,7 +5994,7 @@ CheckAbstractUsage(*this, D).Visit(TL, Sel); } -} +} // namespace /// Check for invalid uses of an abstract type in a function declaration. static void CheckAbstractClassUsage(AbstractUsageInfo &Info, @@ -7386,7 +7386,7 @@ S.popCodeSynthesisContext(); } }; -} +} // namespace static Sema::ImplicitExceptionSpecification ComputeDefaultedSpecialMemberExceptionSpec( @@ -8534,7 +8534,7 @@ SourceRange(Loc, Loc), SourceRange(Loc, Loc)); } }; -} +} // namespace /// Perform the unqualified lookups that might be needed to form a defaulted /// comparison function for the given operator. @@ -9079,7 +9079,7 @@ return false; } }; -} +} // namespace namespace { struct SpecialMemberDeletionInfo @@ -9119,7 +9119,7 @@ bool isAccessible(Subobject Subobj, CXXMethodDecl *D); }; -} +} // namespace /// Is the given special member inaccessible when used on the given /// sub-object. @@ -11068,7 +11068,7 @@ Sema::SemaDiagnosticBuilder Diagnostic; std::string Specifiers; }; -} +} // namespace /// Check the validity of a declarator that we parsed for a deduction-guide. /// These aren't actually declarators in the grammar, so we need to check that @@ -11169,7 +11169,7 @@ // This could still instantiate to the right type, unless we know it // names the wrong class template. auto *TD = SpecifiedName.getAsTemplateDecl(); - MightInstantiateToSpecialization = !(TD && isa(TD) && + MightInstantiateToSpecialization = !(isa_and_nonnull(TD) && !TemplateMatches); } } else if (!RetTy.hasQualifiers() && RetTy->isDependentType()) { @@ -11714,7 +11714,7 @@ } }; -} +} // namespace static bool TryNamespaceTypoCorrection(Sema &S, LookupResult &R, Scope *Sc, CXXScopeSpec &SS, @@ -12190,7 +12190,7 @@ NonTemplateTarget = TargetTD->getTemplatedDecl(); UsingShadowDecl *Shadow; - if (NonTemplateTarget && isa(NonTemplateTarget)) { + if (isa_and_nonnull(NonTemplateTarget)) { UsingDecl *Using = cast(BUD); bool IsVirtualBase = isVirtualDirectBase(cast(CurContext), @@ -13313,7 +13313,7 @@ void visitSubobjectCall(Subobject Subobj, Sema::SpecialMemberOverloadResult SMOR); }; -} +} // namespace bool SpecialMemberExceptionSpecInfo::visitBase(CXXBaseSpecifier *Base) { auto *RT = Base->getType()->getAs(); @@ -13477,7 +13477,7 @@ return WasAlreadyBeingDeclared; } }; -} +} // namespace void Sema::CheckImplicitSpecialMemberDeclaration(Scope *S, FunctionDecl *FD) { // Look up any existing declarations, but don't trigger declaration of all @@ -16821,7 +16821,7 @@ std::string InnerCondDescription; std::tie(InnerCond, InnerCondDescription) = findFailedBooleanCondition(Converted.get()); - if (InnerCond && isa(InnerCond)) { + if (isa_and_nonnull(InnerCond)) { // Drill down into concept specialization expressions to see why they // weren't satisfied. Diag(AssertExpr->getBeginLoc(), diag::err_static_assert_failed) @@ -18275,7 +18275,7 @@ return false; } }; -} +} // namespace bool Sema::checkThisInStaticMemberFunctionType(CXXMethodDecl *Method) { TypeSourceInfo *TSInfo = Method->getTypeSourceInfo();