[clang] Fix error that reference to PointerType is ambiguous in clang/lib/Analysis/UnsafeBufferUsage.cpp (PR #142966)

via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 5 06:48:46 PDT 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff HEAD~1 HEAD --extensions cpp -- clang/lib/Analysis/UnsafeBufferUsage.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/Analysis/UnsafeBufferUsage.cpp b/clang/lib/Analysis/UnsafeBufferUsage.cpp
index e874a483a..ecd67c19e 100644
--- a/clang/lib/Analysis/UnsafeBufferUsage.cpp
+++ b/clang/lib/Analysis/UnsafeBufferUsage.cpp
@@ -968,7 +968,8 @@ static bool hasUnsafePrintfStringArg(const CallExpr &Node, ASTContext &Ctx,
   if (!FirstParmTy->isPointerType())
     return false; // possibly some user-defined printf function
 
-  QualType FirstPteTy = FirstParmTy->castAs<clang::PointerType>()->getPointeeType();
+  QualType FirstPteTy =
+      FirstParmTy->castAs<clang::PointerType>()->getPointeeType();
 
   if (!Ctx.getFILEType()
            .isNull() && //`FILE *` must be in the context if it is fprintf
@@ -1052,7 +1053,8 @@ static bool hasUnsafeSnprintfBuffer(const CallExpr &Node,
   if (!FirstParmTy->isPointerType())
     return false; // Not an snprint
 
-  QualType FirstPteTy = FirstParmTy->castAs<clang::PointerType>()->getPointeeType();
+  QualType FirstPteTy =
+      FirstParmTy->castAs<clang::PointerType>()->getPointeeType();
   const Expr *Buf = Node.getArg(0), *Size = Node.getArg(1);
 
   if (FirstPteTy.isConstQualified() || !Buf->getType()->isPointerType() ||

``````````

</details>


https://github.com/llvm/llvm-project/pull/142966


More information about the cfe-commits mailing list