diff options
Diffstat (limited to 'gcc/fortran/primary.c')
-rw-r--r-- | gcc/fortran/primary.c | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c index 67105cc..7c221c8 100644 --- a/gcc/fortran/primary.c +++ b/gcc/fortran/primary.c @@ -1998,28 +1998,6 @@ is_inquiry_ref (const char *name, gfc_ref **ref) else return false; - switch (type) - { - case INQUIRY_RE: - case INQUIRY_IM: - if (!gfc_notify_std (GFC_STD_F2008, "RE or IM part_ref at %C")) - return false; - break; - - case INQUIRY_KIND: - if (!gfc_notify_std (GFC_STD_F2003, "KIND part_ref at %C")) - return false; - break; - - case INQUIRY_LEN: - if (!gfc_notify_std (GFC_STD_F2003, "LEN part_ref at %C")) - return false; - break; - - default: - gcc_unreachable (); - } - if (ref) { *ref = gfc_get_ref (); @@ -2267,6 +2245,27 @@ gfc_match_varspec (gfc_expr *primary, int equiv_flag, bool sub_flag, { if (tmp) { + switch (tmp->u.i) + { + case INQUIRY_RE: + case INQUIRY_IM: + if (!gfc_notify_std (GFC_STD_F2008, + "RE or IM part_ref at %C")) + return MATCH_ERROR; + break; + + case INQUIRY_KIND: + if (!gfc_notify_std (GFC_STD_F2003, + "KIND part_ref at %C")) + return MATCH_ERROR; + break; + + case INQUIRY_LEN: + if (!gfc_notify_std (GFC_STD_F2003, "LEN part_ref at %C")) + return MATCH_ERROR; + break; + } + if ((tmp->u.i == INQUIRY_RE || tmp->u.i == INQUIRY_IM) && primary->ts.type != BT_COMPLEX) { |