r256349 - Replace isa+cast with dyn_cast and obey the no else after return rule.

Yaron Keren via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 23 12:38:13 PST 2015


Author: yrnkrn
Date: Wed Dec 23 14:38:13 2015
New Revision: 256349

URL: http://llvm.org/viewvc/llvm-project?rev=256349&view=rev
Log:
Replace isa+cast with dyn_cast and obey the no else after return rule.


Modified:
    cfe/trunk/lib/Sema/SemaExpr.cpp

Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=256349&r1=256348&r2=256349&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Wed Dec 23 14:38:13 2015
@@ -4928,14 +4928,10 @@ Sema::ActOnCallExpr(Scope *S, Expr *Fn,
     // We aren't supposed to apply this logic for if there's an '&' involved.
     if (!find.HasFormOfMemberPointer) {
       OverloadExpr *ovl = find.Expression;
-      if (isa<UnresolvedLookupExpr>(ovl)) {
-        UnresolvedLookupExpr *ULE = cast<UnresolvedLookupExpr>(ovl);
+      if (UnresolvedLookupExpr *ULE = dyn_cast<UnresolvedLookupExpr>(ovl))
         return BuildOverloadedCallExpr(S, Fn, ULE, LParenLoc, ArgExprs,
                                        RParenLoc, ExecConfig);
-      } else {
-        return BuildCallToMemberFunction(S, Fn, LParenLoc, ArgExprs,
-                                         RParenLoc);
-      }
+      return BuildCallToMemberFunction(S, Fn, LParenLoc, ArgExprs, RParenLoc);
     }
   }
 




More information about the cfe-commits mailing list