Properly use local variable declaration inside a switch case
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39777 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/AST/Expr.cpp b/AST/Expr.cpp
index b7dbcc7..e22e80e 100644
--- a/AST/Expr.cpp
+++ b/AST/Expr.cpp
@@ -211,9 +211,10 @@
if (isa<VarDecl>(cast<DeclRefExpr>(this)->getDecl()))
return LV_Valid;
break;
- case MemberExprClass: // C99 6.5.2.3p4
+ case MemberExprClass: { // C99 6.5.2.3p4
const MemberExpr *m = cast<MemberExpr>(this);
return m->isArrow() ? LV_Valid : m->getBase()->isLvalue();
+ }
case UnaryOperatorClass: // C99 6.5.3p4
if (cast<UnaryOperator>(this)->getOpcode() == UnaryOperator::Deref)
return LV_Valid;