summaryrefslogtreecommitdiff
path: root/clang
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2012-11-01 14:32:20 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2012-11-01 14:32:20 +0000
commit973aa207e8744a278c3ad72dda91a197be9c6493 (patch)
treea47daa102f02175756ee8a97f2033eae04e4c2ac /clang
parentda2afc9a709d65402d7a1ce68ba6b05a3ec511a7 (diff)
downloadllvm-973aa207e8744a278c3ad72dda91a197be9c6493.tar.gz
Fix an incorrect assert, the LHS can be an LValue.
llvm-svn: 167232
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/AST/Expr.cpp2
-rw-r--r--clang/test/SemaCXX/crashes.cpp12
2 files changed, 13 insertions, 1 deletions
diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp
index 114aad54638d..61dd8bd5a6f1 100644
--- a/clang/lib/AST/Expr.cpp
+++ b/clang/lib/AST/Expr.cpp
@@ -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>();
diff --git a/clang/test/SemaCXX/crashes.cpp b/clang/test/SemaCXX/crashes.cpp
index b8b782a99820..f5682bd74d92 100644
--- a/clang/test/SemaCXX/crashes.cpp
+++ b/clang/test/SemaCXX/crashes.cpp
@@ -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;
+ }
+}