https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66043
kargl at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2015-05-07
CC| |kargl at gcc dot gnu.org
Ever confirmed|0 |1
--- Comment #1 from kargl at gcc dot gnu.org ---
Confirmned.
In reviewing the draft of the F2008 standard, the argument of
storage_size "shall not be an unallocated allocatable variable
or a disassociated or undefined pointer."
This suggests the following patch (watch cut-n-paste tab
corruption):
Index: check.c
===================================================================
--- check.c (revision 222869)
+++ check.c (working copy)
@@ -6243,6 +6243,16 @@ gfc_check_and (gfc_expr *i, gfc_expr *j)
bool
gfc_check_storage_size (gfc_expr *a, gfc_expr *kind)
{
+ if (a->expr_type == EXPR_NULL)
+ {
+ gfc_error ("%qs argument of %qs intrinsic at %L shall not be an "
+ "unallocated allocatable variable or a disassociated or "
+ "undefined pointer",
+ gfc_current_intrinsic_arg[0]->name, gfc_current_intrinsic,
+ &a->where);
+ return false;
+ }
+
if (a->ts.type == BT_ASSUMED)
{
gfc_error ("%qs argument of %qs intrinsic at %L shall not be TYPE(*)",
This then yields
% gfc6 -c po.f90
po.f90:2:28:
print *, storage_size(null())
1
Error: 'a' argument of 'storage_size' intrinsic at (1) shall not be an
unallocated allocatable variable or a disassociated or undefined pointer