Update ImplicitCastExpr to be able to represent an XValue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108807 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/ExprClassification.cpp b/lib/AST/ExprClassification.cpp
index 60ac347..429366e 100644
--- a/lib/AST/ExprClassification.cpp
+++ b/lib/AST/ExprClassification.cpp
@@ -134,10 +134,16 @@
     // Implicit casts are lvalues if they're lvalue casts. Other than that, we
     // only specifically record class temporaries.
   case Expr::ImplicitCastExprClass:
-    if (cast<ImplicitCastExpr>(E)->isLvalueCast())
+    switch (cast<ImplicitCastExpr>(E)->getCategory()) {
+    case ImplicitCastExpr::RValue:
+      return Lang.CPlusPlus && E->getType()->isRecordType() ?
+        Cl::CL_ClassTemporary : Cl::CL_PRValue;
+    case ImplicitCastExpr::LValue:
       return Cl::CL_LValue;
-    return Lang.CPlusPlus && E->getType()->isRecordType() ?
-      Cl::CL_ClassTemporary : Cl::CL_PRValue;
+    case ImplicitCastExpr::XValue:
+      return Cl::CL_XValue;
+    }
+    llvm_unreachable("Invalid value category of implicit cast.");
 
     // C++ [expr.prim.general]p4: The presence of parentheses does not affect
     //   whether the expression is an lvalue.