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, Fortran, OOP] PR 44212: ICE when defining a pointer component before defining the class and calling a TBP then


2010/5/22 Jerry DeLisle <jvdelisle@verizon.net>:
> On 05/22/2010 06:53 AM, Janus Weil wrote:
>>
>> Hi all,
>>
>> here is the fix for a problem with situations like this:
>>
>> ?type :: B_type
>> ? ? class(A_type),pointer :: A_comp
>> ?end type
>>
>> ?type :: A_type
>> ?contains
>> ? ? procedure :: A_proc
>> ?end type
>>
>> It is allowed by the standard to define class-pointer components of a
>> type which is being defined afterwards only (here: "A_type"). The
>> problem was that we usually build all the class containers and vtabs
>> already when parsing the CLASS statement. For the class container this
>> is no problem, but for the vtab it is not possible, since we don't
>> know the TBPs of "A_type" yet. So we basically have to wait until
>> resolution stage with building the vtab.
>>
>> Doing this unveiled a bug in the parsing of SELECT TYPE statements
>> (reported by Dominique in comment #3): When hitting an error while
>> parsing, we forgot to jump out of the already created local block
>> namespace for the SELECT TYPE block.
>>
>> The patch was regtested on x86_64-unknown-linux-gnu. Ok for trunk?
>>
>
> OK, thanks for patch.

Thanks, Jerry. Committed as r159745.

Cheers,
Janus


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