https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66043
--- Comment #3 from Steve Kargl <sgk at troutmask dot apl.washington.edu> --- On Thu, May 07, 2015 at 05:39:44PM +0000, sgk at troutmask dot apl.washington.edu wrote: > > The above patch is good enough to catch the direct use > of NULL() in storage_size. The following should also > be rejected: > > program p > real, allocatable :: a > real, pointer :: b => null() > print *, storage_size(a) ! unallocated allocatable > print *, storage_size(b) ! disassociated pointer > end program p > > For 'b' we need to check > > a->symtree->n.sym->attr && > a->symtree->n->sym.value->expr_type = EXPR_NULL > Dang. Couldn't get gfc_check_storage_size to reject this one.