[clang] 8aa6511 - [clang][NFC] Remove an unnecessary `const_cast`

Vlad Serebrennikov via cfe-commits cfe-commits at lists.llvm.org
Fri May 17 09:10:40 PDT 2024


Author: Vlad Serebrennikov
Date: 2024-05-17T19:10:34+03:00
New Revision: 8aa6511f4209bba33a74c4ef6e208fda5c0f3d27

URL: https://github.com/llvm/llvm-project/commit/8aa6511f4209bba33a74c4ef6e208fda5c0f3d27
DIFF: https://github.com/llvm/llvm-project/commit/8aa6511f4209bba33a74c4ef6e208fda5c0f3d27.diff

LOG: [clang][NFC] Remove an unnecessary `const_cast`

Added: 
    

Modified: 
    clang/lib/Sema/Sema.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp
index c9bc46414c7d2..6c548f374cbe0 100644
--- a/clang/lib/Sema/Sema.cpp
+++ b/clang/lib/Sema/Sema.cpp
@@ -2462,7 +2462,7 @@ bool Sema::tryExprAsCall(Expr &E, QualType &ZeroArgCallReturnTy,
   const OverloadExpr *Overloads = nullptr;
   bool IsMemExpr = false;
   if (E.getType() == Context.OverloadTy) {
-    OverloadExpr::FindResult FR = OverloadExpr::find(const_cast<Expr*>(&E));
+    OverloadExpr::FindResult FR = OverloadExpr::find(&E);
 
     // Ignore overloads that are pointer-to-member constants.
     if (FR.HasFormOfMemberPointer)


        


More information about the cfe-commits mailing list