[Bug fortran/89067] Inaccurate error message: 'i' at (1) is not a member of the 'x' structure

2020-10-13 Thread antony at cosmologist dot info via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89067

--- Comment #4 from Antony Lewis  ---
I agree it may be technically correct, but it is not helpful (esp. if your base
class is an empty hierarchy root class, so all derived classes in the program
would give this same error).

[Bug fortran/89067] Inaccurate error message: 'i' at (1) is not a member of the 'x' structure

2020-09-19 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89067

kargl at gcc dot gnu.org changed:

   What|Removed |Added

 CC||kargl at gcc dot gnu.org

--- Comment #3 from kargl at gcc dot gnu.org ---
(In reply to Antony Lewis from comment #1)
> The error message on this code
> 
> subroutine test
> type x
> end type
> type, extends(x):: y
> integer ii
> end type
> type(y) yy
> 
> yy%i=1
> end subroutine
> 
> is  
> 
> 
> Error: 'i' at (1) is not a member of the 'x' structure
> 
> But it should refer to the 'y' structure, not the base class 'x'. Obviously
> minor and low priority, but more less helpful if y is a deep derived class.

This error can be considered to be correct.  During parsing 'i' is
found not to be a component in 'y', so the compiler goes the next
level up and find that 'i' is not a component in 'x'.  So, the
component is not found in the upper-most level and therefore is
an invalid reference.  This should be closed as WONTFIX.

[Bug fortran/89067] Inaccurate error message: 'i' at (1) is not a member of the 'x' structure

2019-01-26 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89067

Dominique d'Humieres  changed:

   What|Removed |Added

   Priority|P3  |P5
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2019-01-26
 Ever confirmed|0   |1
   Severity|normal  |enhancement

--- Comment #2 from Dominique d'Humieres  ---
Confirmed from at least 4.8 up to trunk (9.0).

[Bug fortran/89067] Inaccurate error message: 'i' at (1) is not a member of the 'x' structure

2019-01-25 Thread antony at cosmologist dot info
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89067

--- Comment #1 from Antony Lewis  ---
The error message on this code

subroutine test
type x
end type
type, extends(x):: y
integer ii
end type
type(y) yy

yy%i=1
end subroutine

is  


Error: 'i' at (1) is not a member of the 'x' structure

But it should refer to the 'y' structure, not the base class 'x'. Obviously
minor and low priority, but more less helpful if y is a deep derived class.