diff options
Diffstat (limited to 'lib/AST')
-rw-r--r-- | lib/AST/Expr.cpp | 4 | ||||
-rw-r--r-- | lib/AST/ExprClassification.cpp | 7 | ||||
-rw-r--r-- | lib/AST/ExprConstant.cpp | 4 |
3 files changed, 7 insertions, 8 deletions
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index 1598227249..59de3fe6ee 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -1055,10 +1055,6 @@ const char *CastExpr::getCastKindName() const { return "IntegralComplexCast"; case CK_IntegralComplexToFloatingComplex: return "IntegralComplexToFloatingComplex"; - case CK_ResolveUnknownAnyType: - return "ResolveUnknownAnyType"; - case CK_ResolveUnknownAnyTypeToReference: - return "ResolveUnknownAnyTypeToReference"; } llvm_unreachable("Unhandled cast kind!"); diff --git a/lib/AST/ExprClassification.cpp b/lib/AST/ExprClassification.cpp index f90d59f505..e94ae82786 100644 --- a/lib/AST/ExprClassification.cpp +++ b/lib/AST/ExprClassification.cpp @@ -170,6 +170,9 @@ static Cl::Kinds ClassifyInternal(ASTContext &Ctx, const Expr *E) { // C++ [expr.prim.general]p3: The result is an lvalue if the entity is a // function or variable and a prvalue otherwise. case Expr::DeclRefExprClass: + if (E->getType() == Ctx.UnknownAnyTy) + return isa<FunctionDecl>(cast<DeclRefExpr>(E)->getDecl()) + ? Cl::CL_PRValue : Cl::CL_LValue; return ClassifyDecl(Ctx, cast<DeclRefExpr>(E)->getDecl()); // We deal with names referenced from blocks the same way. case Expr::BlockDeclRefExprClass: @@ -375,6 +378,10 @@ static Cl::Kinds ClassifyUnnamed(ASTContext &Ctx, QualType T) { } static Cl::Kinds ClassifyMemberExpr(ASTContext &Ctx, const MemberExpr *E) { + if (E->getType() == Ctx.UnknownAnyTy) + return (isa<FunctionDecl>(E->getMemberDecl()) + ? Cl::CL_PRValue : Cl::CL_LValue); + // Handle C first, it's easier. if (!Ctx.getLangOptions().CPlusPlus) { // C99 6.5.2.3p3 diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp index b2f03a21ba..cdd7efaaf5 100644 --- a/lib/AST/ExprConstant.cpp +++ b/lib/AST/ExprConstant.cpp @@ -1798,8 +1798,6 @@ bool IntExprEvaluator::VisitCastExpr(CastExpr *E) { case CK_GetObjCProperty: case CK_LValueBitCast: case CK_UserDefinedConversion: - case CK_ResolveUnknownAnyType: - case CK_ResolveUnknownAnyTypeToReference: return false; case CK_LValueToRValue: @@ -2353,8 +2351,6 @@ bool ComplexExprEvaluator::VisitCastExpr(CastExpr *E) { case CK_GetObjCProperty: case CK_LValueBitCast: case CK_UserDefinedConversion: - case CK_ResolveUnknownAnyType: - case CK_ResolveUnknownAnyTypeToReference: return false; case CK_FloatingRealToComplex: { |