From 89508a3fc645ef37340e31c74995c3078e1b1b9b Mon Sep 17 00:00:00 2001 From: "Steven G. Kargl" Date: Fri, 11 Jan 2019 23:41:04 +0000 Subject: re PR fortran/35031 (ELEMENTAL procedure with BIND(C)) 2019-01-11 Steven G. Kargl PR fortran/35031 * decl.c (gfc_match_entry): Check for F2018:C1546. Fix nearby mis-indentation. 2019-01-11 Steven G. Kargl PR fortran/35031 * gfortran.dg/pr35031.f90: new test. From-SVN: r267864 --- gcc/fortran/decl.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'gcc/fortran/decl.c') diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index e5bfc3b..3314e17 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -7431,9 +7431,11 @@ gfc_match_entry (void) gfc_error ("Missing required parentheses before BIND(C) at %C"); return MATCH_ERROR; } - if (!gfc_add_is_bind_c (&(entry->attr), entry->name, - &(entry->declared_at), 1)) - return MATCH_ERROR; + + if (!gfc_add_is_bind_c (&(entry->attr), entry->name, + &(entry->declared_at), 1)) + return MATCH_ERROR; + } if (!gfc_current_ns->parent @@ -7517,6 +7519,14 @@ gfc_match_entry (void) return MATCH_ERROR; } + /* F2018:C1546 An elemental procedure shall not have the BIND attribute. */ + if (proc->attr.elemental && entry->attr.is_bind_c) + { + gfc_error ("ENTRY statement at %L with BIND(C) prohibited in an " + "elemental procedure", &entry->declared_at); + return MATCH_ERROR; + } + entry->attr.recursive = proc->attr.recursive; entry->attr.elemental = proc->attr.elemental; entry->attr.pure = proc->attr.pure; -- cgit v1.1