This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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, Fortran, OOP] PR 56266: ICE on invalid in gfc_match_varspec


Janus Weil wrote:
As the comment says which the patch is removing, the gfc_match_varspec
should be relevant for cases like this:

print *,char_func()(1:3)
print *,array_func()(2)
print *,derived_type_func()%comp

Are we sure that all of these are actually invalid? (At least they are
rejected by gfortran.) Or are there other cases which would be valid?

They are all invalid. The only exception is that a function itself is regarded as variable (if it returns a pointer):

   f() = 5

That's a new Fortran 2008 feature, which caused quite some trouble with user-defined operators, e.g. something like:

  123 .foo. 5 = ...

where "123" could be an argument (binary operator) or a label (+plus unary operator). (When we implement it, we should do some careful interpretation-request reading.)

However, I think that doesn't affect the code you are removing. (Disclaimer: I haven't looked at the actual patch.)

Tobias


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