r185684 - Sema: Call IgnoreParens fewer times in CheckAddressOfOperand

David Majnemer david.majnemer at gmail.com
Thu Jul 4 23:23:33 PDT 2013


Author: majnemer
Date: Fri Jul  5 01:23:33 2013
New Revision: 185684

URL: http://llvm.org/viewvc/llvm-project?rev=185684&view=rev
Log:
Sema: Call IgnoreParens fewer times in CheckAddressOfOperand

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=185684&r1=185683&r2=185684&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Fri Jul  5 01:23:33 2013
@@ -8336,15 +8336,15 @@ static QualType CheckAddressOfOperand(Se
                                       SourceLocation OpLoc) {
   if (const BuiltinType *PTy = OrigOp.get()->getType()->getAsPlaceholderType()){
     if (PTy->getKind() == BuiltinType::Overload) {
-      if (!isa<OverloadExpr>(OrigOp.get()->IgnoreParens())) {
-        assert(cast<UnaryOperator>(OrigOp.get()->IgnoreParens())->getOpcode()
-                 == UO_AddrOf);
+      Expr *E = OrigOp.get()->IgnoreParens();
+      if (!isa<OverloadExpr>(E)) {
+        assert(cast<UnaryOperator>(E)->getOpcode() == UO_AddrOf);
         S.Diag(OpLoc, diag::err_typecheck_invalid_lvalue_addrof_addrof_function)
           << OrigOp.get()->getSourceRange();
         return QualType();
       }
 
-      OverloadExpr *Ovl = cast<OverloadExpr>(OrigOp.get()->IgnoreParens());
+      OverloadExpr *Ovl = cast<OverloadExpr>(E);
       if (isa<UnresolvedMemberExpr>(Ovl))
         if (!S.ResolveSingleFunctionTemplateSpecialization(Ovl)) {
           S.Diag(OpLoc, diag::err_invalid_form_pointer_member_function)





More information about the cfe-commits mailing list