On Mon, Feb 28, 2022 at 06:33:15PM +0100, Mikael Morin wrote: > > It is true that the spots I saw in fortran/openmp.cc that test rank look > > like: > > if (!gfc_resolve_expr (el->expr) > > || el->expr->ts.type != BT_INTEGER || el->expr->rank != 0) > > etc., so probably !gfc_resolve_expr call is missing. > > > As long as the expression is expected to not be a (contained) function call, > I think it should work. > > In the general case non-syntaxic errors are preferably checked and reported > later at resolution stage, where contained functions are known.
Oh, I've missed that it is done during parsing and not during resolution. That !gfc_resolve_expr call and the checking if it is BT_INTEGER etc. should be certainly moved to resolve_omp_clauses. Jakub