Fix an incorrect assert, the LHS can be an LValue.
authorRafael Espindola <rafael.espindola@gmail.com>
Thu, 1 Nov 2012 14:32:20 +0000 (14:32 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Thu, 1 Nov 2012 14:32:20 +0000 (14:32 +0000)
llvm-svn: 167232

clang/lib/AST/Expr.cpp
clang/test/SemaCXX/crashes.cpp

index 114aad5..61dd8bd 100644 (file)
@@ -81,7 +81,7 @@ Expr::skipRValueSubobjectAdjustments(
       }
     } else if (const BinaryOperator *BO = dyn_cast<BinaryOperator>(E)) {
       if (BO->isPtrMemOp()) {
-        assert(BO->getLHS()->isRValue());
+        assert(BO->getRHS()->isRValue());
         E = BO->getLHS();
         const MemberPointerType *MPT =
           BO->getRHS()->getType()->getAs<MemberPointerType>();
index b8b782a..f5682bd 100644 (file)
@@ -159,3 +159,15 @@ namespace test2 {
     }
   }
 }
+
+namespace test3 {
+  struct nsCSSRect {
+  };
+  static int nsCSSRect::* sides;
+  nsCSSRect dimenX;
+  void ParseBoxCornerRadii(int y) {
+    switch (y) {
+    }
+    int& x = dimenX.*sides;
+  }
+}