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 ();
{
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)
{
subroutine s (x)
complex, parameter :: z = 3
- real(z% kind) :: x ! { dg-error "nonderived-type variable" }
+ real(z% kind) :: x ! { dg-error "Fortran 2003: KIND part_ref" }
type t
real :: kind
logical :: re
end type t
type(t) :: b
print *, b% kind, b% re
- print *, z% re ! { dg-error "nonderived-type variable" }
+ print *, z% re ! { dg-error "Fortran 2008: RE or IM part_ref" }
end