aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/primary.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/primary.c')
-rw-r--r--gcc/fortran/primary.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c
index eb2d780..2cdc9a4 100644
--- a/gcc/fortran/primary.c
+++ b/gcc/fortran/primary.c
@@ -3298,6 +3298,15 @@ gfc_match_rvalue (gfc_expr **result)
if (sym->result == NULL)
sym->result = sym;
+ gfc_gobble_whitespace ();
+ /* F08:C612. */
+ if (gfc_peek_ascii_char() == '%')
+ {
+ gfc_error ("The leftmost part-ref in a data-ref can not be a "
+ "function reference at %C");
+ m = MATCH_ERROR;
+ }
+
m = MATCH_YES;
break;