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] |
Hi all, this patch fixes an ICE on invalid code involving class component declarations. The ICE is avoided by moving forward the error check from resolution to parsing stage. For class components this is possible, because the attributes have to be specified in the same line (in contrast to class variables, where the attributes can be specified in multiple statements, so that checking can only be done during resolution). Note that this fixes only the original example, but not comment 2 (which is a different issue). Regtests cleanly on x86_64-linux-gnu. Ok for trunk? Cheers, Janus 2016-11-12 Janus Weil <janus@gcc.gnu.org> PR fortran/66366 * resolve.c (resolve_component): Move check for C437 to ... * decl.c (build_struct): ... here. Fix indentation. 2016-11-12 Janus Weil <janus@gcc.gnu.org> PR fortran/66366 * gfortran.dg/class_60.f90: New test.
Attachment:
pr66366.diff
Description: Text document
! { dg-do compile } ! ! PR 66366: [OOP] ICE on invalid with non-allocatable CLASS variable ! ! Contributed by Andrew Benson <abensonca@gmail.com> module bug type :: t1d contains procedure :: interpolate => interp end type t1d type :: tff class(t1d) :: transfer ! { dg-error "must be allocatable or pointer" } end type tff contains double precision function interp(self) implicit none class(t1d), intent(inout) :: self return end function interp double precision function fvb(self) implicit none class(tff), intent(inout) :: self fvb=self%transfer%interpolate() ! { dg-error "is not a member of" } return end function fvb end module bug
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |