This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] PR fortran/68151 -- Check CASE selector for valid type


On Mon, Nov 02, 2015 at 12:33:25PM +0100, Mikael Morin wrote:
> 
> Le 01/11/2015 22:16, Steve Kargl a écrit :
> > The attach patch add checking for a valid type during
> > matching of a CASE selector.  Built and regression
> > tested on i386-*-freebsd.  OK to commit?
> 
> [...]
> 
> > Index: gcc/fortran/match.c
> > ===================================================================
> > --- gcc/fortran/match.c	(revision 229634)
> > +++ gcc/fortran/match.c	(working copy)
> > @@ -5036,6 +5036,15 @@ match_case_selector (gfc_case **cp)
> >  	goto need_expr;
> >        if (m == MATCH_ERROR)
> >  	goto cleanup;
> > +
> > +      /* F08:C830 case-expr shall be of type character, integer, or logical.  */
> case-expr is the expression appearing in a SELECT CASE statement (k in 
> the test), while here the problem is in a CASE statement, dealing with 
> value-expr's.
> So I think C830 doesn't apply here.  But you can rely on F08:C832 saying:
>    "For a given case-construct, each case-value shall be of the same 
> type as case-expr"
> The type of case-expr is only checked in resolve_select, so the check 
> for the value-expr's should probably happen there as well.
> 

Thanks for the correction.  I'll update the comment
and check to see if F08:C832 is enforced

-- 
Steve


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]