diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index 11fcc419a5..5205702f29 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -453,6 +453,8 @@ bool Expr::hasGlobalStorage() const { const Decl *D = cast(this)->getDecl(); if (const VarDecl *VD = dyn_cast(D)) return VD->hasGlobalStorage(); + if (isa(D)) + return true; return false; } case MemberExprClass: { diff --git a/test/Sema/address-constant.c b/test/Sema/address-constant.c index 0b451cc39c..e1704b8b0e 100644 --- a/test/Sema/address-constant.c +++ b/test/Sema/address-constant.c @@ -5,3 +5,6 @@ int a[] = {0}; struct { int i; } s; int *array[] = {&i, a, &s.i}; + +extern void f(void); +void (*f_addr)(void) = &f;