diff options
Diffstat (limited to 'contrib/llvm/tools/clang/lib/AST/ExprClassification.cpp')
-rw-r--r-- | contrib/llvm/tools/clang/lib/AST/ExprClassification.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/contrib/llvm/tools/clang/lib/AST/ExprClassification.cpp b/contrib/llvm/tools/clang/lib/AST/ExprClassification.cpp index d3d2530..933ea97 100644 --- a/contrib/llvm/tools/clang/lib/AST/ExprClassification.cpp +++ b/contrib/llvm/tools/clang/lib/AST/ExprClassification.cpp @@ -124,10 +124,11 @@ static Cl::Kinds ClassifyInternal(ASTContext &Ctx, const Expr *E) { case Expr::ObjCPropertyRefExprClass: // C++ [expr.typeid]p1: The result of a typeid expression is an lvalue of... case Expr::CXXTypeidExprClass: - // Unresolved lookups get classified as lvalues. + // Unresolved lookups and uncorrected typos get classified as lvalues. // FIXME: Is this wise? Should they get their own kind? case Expr::UnresolvedLookupExprClass: case Expr::UnresolvedMemberExprClass: + case Expr::TypoExprClass: case Expr::CXXDependentScopeMemberExprClass: case Expr::DependentScopeDeclRefExprClass: // ObjC instance variables are lvalues @@ -181,6 +182,7 @@ static Cl::Kinds ClassifyInternal(ASTContext &Ctx, const Expr *E) { case Expr::AsTypeExprClass: case Expr::ObjCIndirectCopyRestoreExprClass: case Expr::AtomicExprClass: + case Expr::CXXFoldExprClass: return Cl::CL_PRValue; // Next come the complicated cases. @@ -613,14 +615,9 @@ static Cl::ModifiableType IsModifiable(ASTContext &Ctx, const Expr *E, return Cl::CM_IncompleteType; // Records with any const fields (recursively) are not modifiable. - if (const RecordType *R = CT->getAs<RecordType>()) { - assert((E->getObjectKind() == OK_ObjCProperty || - !Ctx.getLangOpts().CPlusPlus) && - "C++ struct assignment should be resolved by the " - "copy assignment operator."); + if (const RecordType *R = CT->getAs<RecordType>()) if (R->hasConstFields()) return Cl::CM_ConstQualified; - } return Cl::CM_Modifiable; } |