Result type compatibility checking for the specified String_Literal
function of a type was too strict, causing valid aspect specifications
to be incorrectly rejected.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* sem_ch13.adb (Validate_Literal_Aspect): Call to Base_Type
needed in order to correctly check result type of String_Literal
function when the first named subtype differs from the base
type (e.g.:
type T is range 1 .. 10 with String_Literal => ... ;
).
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -16228,7 +16228,7 @@ package body Sem_Ch13 is
Is_Match := False;
if Ekind (It.Nam) = E_Function
- and then Base_Type (Etype (It.Nam)) = Typ
+ and then Base_Type (Etype (It.Nam)) = Base_Type (Typ)
then
declare
Params : constant List_Id :=