[COMMITTED] ada: Flag unsupported dispatching constructor calls
Checks
Commit Message
From: Javier Miranda <miranda@adacore.com>
gcc/ada/
* exp_intr.adb
(Expand_Dispatching_Constructor_Call): Improve warning message.
* freeze.adb
(Check_No_Parts_Violations): Improve error message.
Tested on x86_64-pc-linux-gnu, committed on master.
---
gcc/ada/exp_intr.adb | 9 ++++++---
gcc/ada/freeze.adb | 3 +++
2 files changed, 9 insertions(+), 3 deletions(-)
@@ -315,9 +315,12 @@ package body Exp_Intr is
Error_Msg_N
("unsupported dispatching constructor call if the type "
& "of the built object has task components??", N);
- Error_Msg_N
- ("\work around this problem by replacing task components "
- & "with access-to-task-type components??", N);
+
+ Error_Msg_Sloc := Sloc (Root_Type (Etype (Entity (Name (N)))));
+ Error_Msg_NE
+ ("\work around this by adding ''with no_task_parts'' to "
+ & "the declaration of the root type& defined#???",
+ N, Root_Type (Etype (Entity (Name (N)))));
end if;
end if;
@@ -3188,6 +3188,9 @@ package body Freeze is
if Has_Task (Typ) then
Error_Msg_N
("aspect % applied to task type &", Typ);
+ Error_Msg_N
+ ("\replace task components with access-to-task-type "
+ & "components??", Typ);
end if;
else