diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/AST/Expr.cpp | 1 | ||||
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index 1d715b004d..e36ae41ce4 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -1194,7 +1194,6 @@ Expr::isLvalueResult Expr::isLvalueInternal(ASTContext &Ctx) const { case ObjCIsaExprClass: case StringLiteralClass: // C99 6.5.1p4 case ObjCEncodeExprClass: // @encode behaves like its string in every way. - case ObjCSelectorExprClass: // @selector return LV_Valid; case ArraySubscriptExprClass: // C99 6.5.3p4 (e1[e2] == (*((e1)+(e2)))) // For vectors, make sure base is an lvalue (i.e. not a function call). diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index ae56018b99..fa403c78d0 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -6060,6 +6060,8 @@ QualType Sema::CheckAddressOfOperand(Expr *op, SourceLocation OpLoc) { << op->getType() << op->getSourceRange(); if (isSFINAEContext()) return QualType(); + } else if (isa<ObjCSelectorExpr>(op)) { + return Context.getPointerType(op->getType()); } else if (lval != Expr::LV_Valid && lval != Expr::LV_IncompleteVoidType) { // C99 6.5.3.2p1 // The operand must be either an l-value or a function designator |