diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2023-07-05 22:04:07 +0200 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2023-07-18 15:11:47 +0200 |
commit | 086a2c9d042f14397dcde345c5011e20cc6016f4 (patch) | |
tree | ea869fbce186e19c9364336ca4b263a44a007701 /gcc/ada/sem_util.ads | |
parent | e273cf2c1e7fb02eea3b73d8683c6591386587b4 (diff) | |
download | gcc-086a2c9d042f14397dcde345c5011e20cc6016f4.zip gcc-086a2c9d042f14397dcde345c5011e20cc6016f4.tar.gz gcc-086a2c9d042f14397dcde345c5011e20cc6016f4.tar.bz2 |
ada: Improve error message for ambiguous subprogram call
This restores the full listing of the types for the interpretations.
gcc/ada/
* sem_util.ads (Wrong_Type): Add Multiple parameter defaulting to
False and document it.
* sem_util.adb (Wrong_Type): Do not return early if an error has
already been posted on Expr and Multiple is True.
* sem_ch4.adb (Analyze_One_Call): Pass All_Errors_Mode as the
actual parameter for Multiple to Wrong_Type.
Diffstat (limited to 'gcc/ada/sem_util.ads')
-rw-r--r-- | gcc/ada/sem_util.ads | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads index 7fc77de..b56a235 100644 --- a/gcc/ada/sem_util.ads +++ b/gcc/ada/sem_util.ads @@ -3362,12 +3362,16 @@ package Sem_Util is -- is potentially issued: it is the visible entity in the former case, and -- the use_clause in the latter case. - procedure Wrong_Type (Expr : Node_Id; Expected_Type : Entity_Id); + procedure Wrong_Type + (Expr : Node_Id; + Expected_Type : Entity_Id; + Multiple : Boolean := False); -- Output error message for incorrectly typed expression. Expr is the node -- for the incorrectly typed construct (Etype (Expr) is the type found), -- and Expected_Type is the entity for the expected type. Note that Expr -- does not have to be a subexpression, anything with an Etype field may - -- be used. + -- be used. If Multiple is False, do not output the message if an error + -- has already been posted for Expr. function Yields_Synchronized_Object (Typ : Entity_Id) return Boolean; -- Determine whether type Typ "yields synchronized object" as specified by |