diff options
author | Javier Miranda <miranda@adacore.com> | 2022-11-07 09:28:56 +0000 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2022-11-14 14:46:51 +0100 |
commit | 0e194d289d4d1c9aa16d14c4b94caf11c2506da3 (patch) | |
tree | 743670d6c71de21e0846b2e7eccea6f2f31c597f /gcc | |
parent | f3597ba6c5ea9c0eb2c3dac7271f8a8bf9fbb220 (diff) | |
download | gcc-0e194d289d4d1c9aa16d14c4b94caf11c2506da3.zip gcc-0e194d289d4d1c9aa16d14c4b94caf11c2506da3.tar.gz gcc-0e194d289d4d1c9aa16d14c4b94caf11c2506da3.tar.bz2 |
ada: Flag unsupported dispatching constructor calls
gcc/ada/
* exp_intr.adb
(Expand_Dispatching_Constructor_Call): Improve warning message.
* freeze.adb
(Check_No_Parts_Violations): Improve error message.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/exp_intr.adb | 9 | ||||
-rw-r--r-- | gcc/ada/freeze.adb | 3 |
2 files changed, 9 insertions, 3 deletions
diff --git a/gcc/ada/exp_intr.adb b/gcc/ada/exp_intr.adb index cb9b5be..d18ed69 100644 --- a/gcc/ada/exp_intr.adb +++ b/gcc/ada/exp_intr.adb @@ -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; diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb index 032c73d..7f78b43 100644 --- a/gcc/ada/freeze.adb +++ b/gcc/ada/freeze.adb @@ -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 |