+2018-05-24 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/85895
+ * resolve.c (resolve_sync): Resolve expression before checking for
+ an error.
+
2018-05-22 Janus Weil <janus@gcc.gnu.org>
PR fortran/85841
}
/* Check STAT. */
+ gfc_resolve_expr (code->expr2);
if (code->expr2
&& (code->expr2->ts.type != BT_INTEGER || code->expr2->rank != 0
|| code->expr2->expr_type != EXPR_VARIABLE))
&code->expr2->where);
/* Check ERRMSG. */
+ gfc_resolve_expr (code->expr3);
if (code->expr3
&& (code->expr3->ts.type != BT_CHARACTER || code->expr3->rank != 0
|| code->expr3->expr_type != EXPR_VARIABLE))
+2018-05-24 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/85895
+
+ * gfortran.dg/coarray_3.f90: Fix invalid testcase.
+ * gfortran.dg/pr85895.f90: New test.
+
2018-05-24 Uros Bizjak <ubizjak@gmail.com>
* gcc.target/i386/avx512f-vcvtusi2sd64-1.c: Update scan string.
sync all (stat=1) ! { dg-error "Syntax error in SYNC ALL" }
sync all ( stat = n,stat=k) ! { dg-error "Redundant STAT" }
-sync memory (errmsg=str)
+sync memory (errmsg=str) ! { dg-error "must be a scalar CHARACTER variable" }
sync memory (errmsg=n) ! { dg-error "must be a scalar CHARACTER variable" }
sync images (*, stat=1.0) ! { dg-error "Syntax error in SYNC IMAGES" }
sync images (-1) ! { dg-error "must between 1 and num_images" }
--- /dev/null
+! { dg-do compile }
+! { dg-options "-fcoarray=lib" }
+! PR fortran/85895
+subroutine p
+ character(80) :: c(2)
+ sync memory (errmsg=c) ! { dg-error "scalar CHARACTER variable" }
+end subroutine p
+
+subroutine q
+ character(80) :: c(2)
+ sync memory (errmsg=c(1:2)) ! { dg-error "scalar CHARACTER variable" }
+end subroutine q
+
+subroutine r
+ character(80) :: c(2)
+ sync memory (errmsg=c(1))
+end subroutine r