From 0943168ac126b8047f30f6bd215fbe7db14d61ba Mon Sep 17 00:00:00 2001 From: John McCall Date: Thu, 18 Nov 2010 19:01:18 +0000 Subject: Add an assertion, fix a whole bunch of bugs, comment the assertion out because there are still bugs left. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119722 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AST/ExprClassification.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'lib/AST/ExprClassification.cpp') diff --git a/lib/AST/ExprClassification.cpp b/lib/AST/ExprClassification.cpp index 4677910798..ba5970038d 100644 --- a/lib/AST/ExprClassification.cpp +++ b/lib/AST/ExprClassification.cpp @@ -64,6 +64,21 @@ Cl Expr::ClassifyImpl(ASTContext &Ctx, SourceLocation *Loc) const { kind = Cl::CL_Void; } +#if 0 + // Enable this assertion for testing. + switch (kind) { + case Cl::CL_LValue: assert(getValueKind() == VK_LValue); break; + case Cl::CL_XValue: assert(getValueKind() == VK_XValue); break; + case Cl::CL_Function: + case Cl::CL_Void: + case Cl::CL_DuplicateVectorComponents: + case Cl::CL_MemberFunction: + case Cl::CL_SubObjCPropertySetting: + case Cl::CL_ClassTemporary: + case Cl::CL_PRValue: assert(getValueKind() == VK_RValue); break; + } +#endif + Cl::ModifiableType modifiable = Cl::CM_Untested; if (Loc) modifiable = IsModifiable(Ctx, this, kind, *Loc); @@ -380,6 +395,10 @@ static Cl::Kinds ClassifyMemberExpr(ASTContext &Ctx, const MemberExpr *E) { // *E1 is an lvalue if (E->isArrow()) return Cl::CL_LValue; + Expr *Base = E->getBase()->IgnoreParenImpCasts(); + if (isa(Base) || + isa(Base)) + return Cl::CL_SubObjCPropertySetting; return ClassifyInternal(Ctx, E->getBase()); } -- cgit v1.2.3