[Patch, Fortran, OOP] PR 56266: ICE on invalid in gfc_match_varspec

Janus Weil janus@gcc.gnu.org
Fri Apr 12 18:38:00 GMT 2013


Hi all,

here is a small patch which fixes an ICE-on-invalid problem by simply
turning a "gcc_assert" into a MATCH_ERROR. I am aware that the
resulting error message ("Unclassifiable statement") is not the most
helpful one, but I couldn't come up with something better.

The problem is that "c(i)" is wrongly identified as a function call,
which is the best thing one can do at parsing time. But giving an
error message based on this (wrong) assumption will not be any more
helpful, therefore I prefer the "Unclassifiable statement".

Unless someone has a better idea how to treat this, I will commit the
attached patch as obvious.

Cheers,
Janus


2013-04-12  Janus Weil  <janus@gcc.gnu.org>

    PR fortran/56266
    * primary.c (gfc_match_varspec): Turn gcc_assert into MATCH_ERROR.


2013-04-12  Janus Weil  <janus@gcc.gnu.org>

    PR fortran/56261
    * gfortran.dg/typebound_proc_28.f03: New.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr56266.diff
Type: application/octet-stream
Size: 814 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20130412/21417dc4/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: typebound_proc_28.f03
Type: application/octet-stream
Size: 504 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20130412/21417dc4/attachment-0001.obj>


More information about the Fortran mailing list