add several cases that Expr::hasStaticStorage missed, pointed out by Oliver Hunt


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44376 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/AST/Expr.cpp b/AST/Expr.cpp
index 9bc6b90..33b56e5 100644
--- a/AST/Expr.cpp
+++ b/AST/Expr.cpp
@@ -360,10 +360,17 @@
   return MLV_Valid;    
 }
 
+/// hasStaticStorage - Return true if this expression has static storage
+/// duration.  This means that the address of this expression is a link-time
+/// constant.
 bool Expr::hasStaticStorage() const {
   switch (getStmtClass()) {
   default:
     return false;
+  case ParenExprClass:
+    return cast<ParenExpr>(this)->getSubExpr()->hasStaticStorage();
+  case ImplicitCastExprClass:
+    return cast<ImplicitCastExpr>(this)->getSubExpr()->hasStaticStorage();
   case DeclRefExprClass: {
     const Decl *D = cast<DeclRefExpr>(this)->getDecl();
     if (const VarDecl *VD = dyn_cast<VarDecl>(D))
@@ -373,6 +380,8 @@
   case MemberExprClass:
     const MemberExpr *M = cast<MemberExpr>(this);
     return !M->isArrow() && M->getBase()->hasStaticStorage();
+  case ArraySubscriptExprClass:
+    return cast<ArraySubscriptExpr>(this)->getBase()->hasStaticStorage();
   }
 }