aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/decl.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r--gcc/fortran/decl.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index 40622e2..52796a6 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -2267,8 +2267,8 @@ done:
}
-/* Matches a type specification. If successful, sets the ts structure
- to the matched specification. This is necessary for FUNCTION and
+/* Matches a declaration-type-spec (F03:R502). If successful, sets the ts
+ structure to the matched specification. This is necessary for FUNCTION and
IMPLICIT statements.
If implicit_flag is nonzero, then we don't check for the optional
@@ -2276,7 +2276,7 @@ done:
statement correctly. */
match
-gfc_match_type_spec (gfc_typespec *ts, int implicit_flag)
+gfc_match_decl_type_spec (gfc_typespec *ts, int implicit_flag)
{
char name[GFC_MAX_SYMBOL_LEN + 1];
gfc_symbol *sym;
@@ -2377,6 +2377,10 @@ gfc_match_type_spec (gfc_typespec *ts, int implicit_flag)
return m;
ts->is_class = 1;
+ if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: CLASS statement at %C")
+ == FAILURE)
+ return MATCH_ERROR;
+
/* TODO: Implement Polymorphism. */
gfc_warning ("Polymorphic entities are not yet implemented. "
"CLASS will be treated like TYPE at %C");
@@ -2599,7 +2603,7 @@ gfc_match_implicit (void)
gfc_clear_new_implicit ();
/* A basic type is mandatory here. */
- m = gfc_match_type_spec (&ts, 1);
+ m = gfc_match_decl_type_spec (&ts, 1);
if (m == MATCH_ERROR)
goto error;
if (m == MATCH_NO)
@@ -3675,7 +3679,7 @@ gfc_match_data_decl (void)
num_idents_on_line = 0;
- m = gfc_match_type_spec (&current_ts, 0);
+ m = gfc_match_decl_type_spec (&current_ts, 0);
if (m != MATCH_YES)
return m;
@@ -3780,7 +3784,7 @@ gfc_match_prefix (gfc_typespec *ts)
loop:
if (!seen_type && ts != NULL
- && gfc_match_type_spec (ts, 0) == MATCH_YES
+ && gfc_match_decl_type_spec (ts, 0) == MATCH_YES
&& gfc_match_space () == MATCH_YES)
{
@@ -4178,7 +4182,7 @@ match_procedure_interface (gfc_symbol **proc_if)
/* Get the type spec. for the procedure interface. */
old_loc = gfc_current_locus;
- m = gfc_match_type_spec (&current_ts, 0);
+ m = gfc_match_decl_type_spec (&current_ts, 0);
gfc_gobble_whitespace ();
if (m == MATCH_YES || (m == MATCH_NO && gfc_peek_ascii_char () == ')'))
goto got_ts;