diff --git a/clang/include/clang/AST/PropertiesBase.td b/clang/include/clang/AST/PropertiesBase.td index cd8b95b02b7b4..c6fe790e1964b 100644 --- a/clang/include/clang/AST/PropertiesBase.td +++ b/clang/include/clang/AST/PropertiesBase.td @@ -497,7 +497,7 @@ let Class = PropertyTypeCase in { } def : Property<"type", QualType> { let Conditional = [{ hasBase && (isTypeInfo || isDynamicAlloc) }]; - let Read = [{ + let Read = [{ isTypeInfo ? node.getLValueBase().getTypeInfoType() : node.getLValueBase().getDynamicAllocType() diff --git a/clang/lib/Analysis/UnsafeBufferUsage.cpp b/clang/lib/Analysis/UnsafeBufferUsage.cpp index 54569b420ca35..5cde60cefdf06 100644 --- a/clang/lib/Analysis/UnsafeBufferUsage.cpp +++ b/clang/lib/Analysis/UnsafeBufferUsage.cpp @@ -1889,11 +1889,11 @@ createOverloadsForFixedParams(unsigned ParmIdx, StringRef NewTyText, const ParmVarDecl *Parm = FD->getParamDecl(i); if (Parm->isImplicit()) - continue; + continue; // FIXME: If a parameter has no name, it is unused in the // definition. So we could just leave it as it is. - if (!Parm->getIdentifier()) - // If a parameter of a function definition has no name: + if (!Parm->getIdentifier()) + // If a parameter of a function definition has no name: return std::nullopt; if (i == ParmIdx) // This is our spanified paramter! @@ -2208,7 +2208,7 @@ void clang::checkUnsafeBufferUsage(const Decl *D, UnsafeBufferUsageHandler &Handler, bool EmitSuggestions) { assert(D && D->getBody()); - + // We do not want to visit a Lambda expression defined inside a method independently. // Instead, it should be visited along with the outer method. if (const auto *fd = dyn_cast(D)) {