aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch6.adb
diff options
context:
space:
mode:
authorYannick Moy <moy@adacore.com>2021-10-08 16:19:50 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2021-12-01 10:24:40 +0000
commit790b8752100e699d98140f0b094cbf5b893aa7dd (patch)
treee7d313e8e288969e63fee93dfca9cbeb0791f5cd /gcc/ada/sem_ch6.adb
parentbe8de8e127b06017f2c3602c81de99ad5937ef9d (diff)
[Ada] Improve error messages for dot notation when -gnatX not used
gcc/ada/ * einfo.ads (Direct_Primitive_Operations): Update the doc to indicate that this field is used for all types now. * sem_ch4.adb (Try_Object_Operation): Add parameter Allow_Extensions set to True to pretend that extensions are allowed. * sem_ch4.ads: Same. * sem_ch6.adb: Do not require Extensions_Allowed. * sem_ch8.adb (Find_Selected_Component): Remove duplicate "where" in comment. Improve the error messages regarding use of prefixed calls.
Diffstat (limited to 'gcc/ada/sem_ch6.adb')
-rw-r--r--gcc/ada/sem_ch6.adb26
1 files changed, 13 insertions, 13 deletions
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb
index af8756b2cca..9c21732e5f9 100644
--- a/gcc/ada/sem_ch6.adb
+++ b/gcc/ada/sem_ch6.adb
@@ -11380,11 +11380,11 @@ package body Sem_Ch6 is
if not Comes_From_Source (S) then
-- Add an inherited primitive for an untagged derived type to
- -- Derived_Type's list of primitives. Tagged primitives are dealt
- -- with in Check_Dispatching_Operation.
+ -- Derived_Type's list of primitives. Tagged primitives are
+ -- dealt with in Check_Dispatching_Operation. Do this even when
+ -- Extensions_Allowed is False to issue better error messages.
if Present (Derived_Type)
- and then Extensions_Allowed
and then not Is_Tagged_Type (Derived_Type)
then
Append_Unique_Elmt (S, Primitive_Operations (Derived_Type));
@@ -11418,13 +11418,13 @@ package body Sem_Ch6 is
Set_Has_Primitive_Operations (B_Typ);
Set_Is_Primitive (S);
- -- Add a primitive for an untagged type to B_Typ's list
- -- of primitives. Tagged primitives are dealt with in
- -- Check_Dispatching_Operation.
+ -- Add a primitive for an untagged type to B_Typ's
+ -- list of primitives. Tagged primitives are dealt with
+ -- in Check_Dispatching_Operation. Do this even when
+ -- Extensions_Allowed is False to issue better error
+ -- messages.
- if Extensions_Allowed
- and then not Is_Tagged_Type (B_Typ)
- then
+ if not Is_Tagged_Type (B_Typ) then
Add_Or_Replace_Untagged_Primitive (B_Typ);
end if;
@@ -11463,11 +11463,11 @@ package body Sem_Ch6 is
-- Add a primitive for an untagged type to B_Typ's list
-- of primitives. Tagged primitives are dealt with in
- -- Check_Dispatching_Operation.
+ -- Check_Dispatching_Operation. Do this even when
+ -- Extensions_Allowed is False to issue better error
+ -- messages.
- if Extensions_Allowed
- and then not Is_Tagged_Type (B_Typ)
- then
+ if not Is_Tagged_Type (B_Typ) then
Add_Or_Replace_Untagged_Primitive (B_Typ);
end if;