[clang] [clang][sema] Remove unused local SourceLocation (PR #151455)

via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 30 22:55:12 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Timm Baeder (tbaederr)

<details>
<summary>Changes</summary>

getIntegerConstantExpr() doesn't force us to pass one, so don't.

---
Full diff: https://github.com/llvm/llvm-project/pull/151455.diff


1 Files Affected:

- (modified) clang/lib/Sema/SemaChecking.cpp (+1-3) 


``````````diff
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index c74b67106ad74..bc87611e1f846 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -15893,9 +15893,7 @@ ExprResult Sema::BuiltinMatrixTranspose(CallExpr *TheCall,
 // Get and verify the matrix dimensions.
 static std::optional<unsigned>
 getAndVerifyMatrixDimension(Expr *Expr, StringRef Name, Sema &S) {
-  SourceLocation ErrorPos;
-  std::optional<llvm::APSInt> Value =
-      Expr->getIntegerConstantExpr(S.Context, &ErrorPos);
+  std::optional<llvm::APSInt> Value = Expr->getIntegerConstantExpr(S.Context);
   if (!Value) {
     S.Diag(Expr->getBeginLoc(), diag::err_builtin_matrix_scalar_unsigned_arg)
         << Name;

``````````

</details>


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


More information about the cfe-commits mailing list