diff options
Diffstat (limited to 'gcc/ada/sem_ch8.adb')
-rw-r--r-- | gcc/ada/sem_ch8.adb | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb index 79fe368..8134973 100644 --- a/gcc/ada/sem_ch8.adb +++ b/gcc/ada/sem_ch8.adb @@ -6119,10 +6119,16 @@ package body Sem_Ch8 is -- is completed in the current scope, and not for a limited -- view of a type. - if not Is_Tagged_Type (T) - and then Ada_Version >= Ada_2005 - then - if From_With_Type (T) then + if Ada_Version >= Ada_2005 then + + -- Test whether the Available_View of a limited type view + -- is tagged, since the limited view may not be marked as + -- tagged if the type itself has an untagged incomplete + -- type view in its package. + + if From_With_Type (T) + and then not Is_Tagged_Type (Available_View (T)) + then Error_Msg_N ("prefix of Class attribute must be tagged", N); Set_Etype (N, Any_Type); |