[cfe-commits] r167232 - in /cfe/trunk: lib/AST/Expr.cpp test/SemaCXX/crashes.cpp

Rafael Espindola rafael.espindola at gmail.com
Thu Nov 1 07:32:20 PDT 2012


Author: rafael
Date: Thu Nov  1 09:32:20 2012
New Revision: 167232

URL: http://llvm.org/viewvc/llvm-project?rev=167232&view=rev
Log:
Fix an incorrect assert, the LHS can be an LValue.

Modified:
    cfe/trunk/lib/AST/Expr.cpp
    cfe/trunk/test/SemaCXX/crashes.cpp

Modified: cfe/trunk/lib/AST/Expr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Expr.cpp?rev=167232&r1=167231&r2=167232&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Expr.cpp (original)
+++ cfe/trunk/lib/AST/Expr.cpp Thu Nov  1 09:32:20 2012
@@ -81,7 +81,7 @@
       }
     } 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>();

Modified: cfe/trunk/test/SemaCXX/crashes.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/crashes.cpp?rev=167232&r1=167231&r2=167232&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/crashes.cpp (original)
+++ cfe/trunk/test/SemaCXX/crashes.cpp Thu Nov  1 09:32:20 2012
@@ -159,3 +159,15 @@
     }
   }
 }
+
+namespace test3 {
+  struct nsCSSRect {
+  };
+  static int nsCSSRect::* sides;
+  nsCSSRect dimenX;
+  void ParseBoxCornerRadii(int y) {
+    switch (y) {
+    }
+    int& x = dimenX.*sides;
+  }
+}





More information about the cfe-commits mailing list