aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJavier Miranda <miranda@adacore.com>2024-11-29 11:05:31 +0000
committerMarc Poulhiès <dkm@gcc.gnu.org>2024-12-13 09:36:01 +0100
commitcee3cf1841d1ecc7e48cba32469d73af4bc62bb6 (patch)
tree9c2fcecbef80c0909c06ebe26efd686b84f12a60 /gcc
parent5bb08a0ea79dc5eda62a66c844c04baa3b82f412 (diff)
downloadgcc-cee3cf1841d1ecc7e48cba32469d73af4bc62bb6.zip
gcc-cee3cf1841d1ecc7e48cba32469d73af4bc62bb6.tar.gz
gcc-cee3cf1841d1ecc7e48cba32469d73af4bc62bb6.tar.bz2
ada: Refactor code of Check_Ambiguous_Call and Valid_Conversion
gcc/ada/ChangeLog: * sem_res.adb (Report_Ambiguous_Argument): Code cleanup. (Resolve): Code cleanup.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/sem_res.adb24
1 files changed, 7 insertions, 17 deletions
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index cd75508..948ed94 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -2435,14 +2435,7 @@ package body Sem_Res is
Get_First_Interp (Name (Arg), I, It);
while Present (It.Nam) loop
- Error_Msg_Sloc := Sloc (It.Nam);
-
- if Nkind (Parent (It.Nam)) = N_Full_Type_Declaration then
- Error_Msg_N ("interpretation (inherited) #!", Arg);
- else
- Error_Msg_N ("interpretation #!", Arg);
- end if;
-
+ Report_Interpretation (Arg, It.Nam, It.Typ);
Get_Next_Interp (I, It);
end loop;
end if;
@@ -2823,13 +2816,10 @@ package body Sem_Res is
Ambiguous := True;
- if Nkind (Parent (Seen)) = N_Full_Type_Declaration then
- Error_Msg_N
- ("\\possible interpretation (inherited)#!", N);
- else
- Error_Msg_N -- CODEFIX
- ("\\possible interpretation#!", N);
- end if;
+ Report_Interpretation
+ (N => N,
+ Nam => Seen,
+ Typ => Etype (Seen));
if Nkind (N) in N_Subprogram_Call
and then Present (Parameter_Associations (N))
@@ -2912,8 +2902,8 @@ package body Sem_Res is
elsif
Nkind (Parent (It.Nam)) = N_Full_Type_Declaration
then
- Error_Msg_N
- ("\\possible interpretation (inherited)#!", N);
+ Report_Interpretation (N, It.Nam, It.Typ);
+
else
Error_Msg_N -- CODEFIX
("\\possible interpretation#!", N);