PR1963: Address of function is a constant expression

llvm-svn: 49212
This commit is contained in:
Seo Sanghyeon 2008-04-04 09:45:30 +00:00
parent 4cbca05d4e
commit 055c94f2f8
2 changed files with 5 additions and 0 deletions

View File

@ -453,6 +453,8 @@ bool Expr::hasGlobalStorage() const {
const Decl *D = cast<DeclRefExpr>(this)->getDecl();
if (const VarDecl *VD = dyn_cast<VarDecl>(D))
return VD->hasGlobalStorage();
if (isa<FunctionDecl>(D))
return true;
return false;
}
case MemberExprClass: {

View File

@ -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;