PR1963: Address of function is a constant expression
llvm-svn: 49212
This commit is contained in:
parent
4cbca05d4e
commit
055c94f2f8
|
@ -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: {
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue