]> gcc.gnu.org Git - gcc.git/blobdiff - gcc/ada/sem_res.adb
[multiple changes]
[gcc.git] / gcc / ada / sem_res.adb
index 7ae5fab45a555db609aea69fb71306c89e609da8..1a2012960d7c4654dc71c24901778a24a17c50a2 100644 (file)
@@ -214,7 +214,8 @@ package body Sem_Res is
    --  to the corresponding predefined operator, with suitable conversions.
 
    procedure Resolve_Intrinsic_Unary_Operator (N : Node_Id; Typ : Entity_Id);
-   --  Ditto, for unary operators (only arithmetic ones)
+   --  Ditto, for unary operators (arithmetic ones and "not" on signed
+   --  integer types for VMS).
 
    procedure Rewrite_Operator_As_Call (N : Node_Id; Nam : Entity_Id);
    --  If an operator node resolves to a call to a user-defined operator,
@@ -273,19 +274,20 @@ package body Sem_Res is
 
    begin
       if Nkind (C) = N_Character_Literal then
-         Error_Msg_N ("ambiguous character literal", C);
+         Error_Msg_N -- CODEFIX???
+           ("ambiguous character literal", C);
 
          --  First the ones in Standard
 
-         Error_Msg_N
+         Error_Msg_N -- CODEFIX???
            ("\\possible interpretation: Character!", C);
-         Error_Msg_N
+         Error_Msg_N -- CODEFIX???
            ("\\possible interpretation: Wide_Character!", C);
 
          --  Include Wide_Wide_Character in Ada 2005 mode
 
          if Ada_Version >= Ada_05 then
-            Error_Msg_N
+            Error_Msg_N -- CODEFIX???
               ("\\possible interpretation: Wide_Wide_Character!", C);
          end if;
 
@@ -293,7 +295,8 @@ package body Sem_Res is
 
          E := Current_Entity (C);
          while Present (E) loop
-            Error_Msg_NE ("\\possible interpretation:}!", C, Etype (E));
+            Error_Msg_NE -- CODEFIX???
+              ("\\possible interpretation:}!", C, Etype (E));
             E := Homonym (E);
          end loop;
       end if;
@@ -633,9 +636,10 @@ package body Sem_Res is
    procedure Check_For_Visible_Operator (N : Node_Id; T : Entity_Id) is
    begin
       if Is_Invisible_Operator (N, T) then
-         Error_Msg_NE
+         Error_Msg_NE -- CODEFIX
            ("operator for} is not directly visible!", N, First_Subtype (T));
-         Error_Msg_N ("use clause would make operation legal!", N);
+         Error_Msg_N -- CODEFIX
+           ("use clause would make operation legal!", N);
       end if;
    end Check_For_Visible_Operator;
 
@@ -1752,7 +1756,8 @@ package body Sem_Res is
            and then Is_Entity_Name (Name (Arg))
            and then Is_Overloaded (Name (Arg))
          then
-            Error_Msg_NE ("ambiguous call to&", Arg, Name (Arg));
+            Error_Msg_NE -- CODEFIX???
+              ("ambiguous call to&", Arg, Name (Arg));
 
             --  Could use comments on what is going on here ???
 
@@ -1761,9 +1766,11 @@ package body Sem_Res is
                Error_Msg_Sloc := Sloc (It.Nam);
 
                if Nkind (Parent (It.Nam)) = N_Full_Type_Declaration then
-                  Error_Msg_N ("interpretation (inherited) #!", Arg);
+                  Error_Msg_N -- CODEFIX???
+                    ("interpretation (inherited) #!", Arg);
                else
-                  Error_Msg_N ("interpretation #!", Arg);
+                  Error_Msg_N -- CODEFIX???
+                    ("interpretation #!", Arg);
                end if;
 
                Get_Next_Interp (I, It);
@@ -2058,7 +2065,7 @@ package body Sem_Res is
                         if Nkind (N) = N_Function_Call
                           and then Nkind (Name (N)) = N_Explicit_Dereference
                         then
-                           Error_Msg_N
+                           Error_Msg_N -- CODEFIX???
                              ("ambiguous expression "
                                & "(cannot resolve indirect call)!", N);
                         else
@@ -2070,7 +2077,7 @@ package body Sem_Res is
                         Ambiguous := True;
 
                         if Nkind (Parent (Seen)) = N_Full_Type_Declaration then
-                           Error_Msg_N
+                           Error_Msg_N -- CODEFIX???
                              ("\\possible interpretation (inherited)#!", N);
                         else
                            Error_Msg_N -- CODEFIX
@@ -2148,19 +2155,19 @@ package body Sem_Res is
                         if  It.Typ = Universal_Fixed
                           and then Scope (It.Nam) = Standard_Standard
                         then
-                           Error_Msg_N
+                           Error_Msg_N -- CODEFIX???
                              ("\\possible interpretation as " &
                                 "universal_fixed operation " &
                                   "(RM 4.5.5 (19))", N);
                         else
-                           Error_Msg_N
+                           Error_Msg_N -- CODEFIX???
                              ("\\possible interpretation (predefined)#!", N);
                         end if;
 
                      elsif
                        Nkind (Parent (It.Nam)) = N_Full_Type_Declaration
                      then
-                        Error_Msg_N
+                        Error_Msg_N -- CODEFIX???
                           ("\\possible interpretation (inherited)#!", N);
                      else
                         Error_Msg_N -- CODEFIX
@@ -2908,7 +2915,7 @@ package body Sem_Res is
                --  Introduce an implicit 'Access in prefix
 
                if not Is_Aliased_View (Act) then
-                  Error_Msg_NE
+                  Error_Msg_NE -- CODEFIX???
                     ("object in prefixed call to& must be aliased"
                          & " (RM-2005 4.3.1 (13))",
                     Prefix (Act), Nam);
@@ -4199,7 +4206,8 @@ package body Sem_Res is
          declare
             Loc : constant Source_Ptr := Sloc (N);
          begin
-            Error_Msg_N ("?allocation from empty storage pool!", N);
+            Error_Msg_N -- CODEFIX???
+              ("?allocation from empty storage pool!", N);
             Error_Msg_N ("\?Storage_Error will be raised at run time!", N);
             Insert_Action (N,
               Make_Raise_Storage_Error (Loc,
@@ -6352,7 +6360,8 @@ package body Sem_Res is
            and then Entity (R) = Standard_True
            and then Comes_From_Source (R)
          then
-            Error_Msg_N ("?comparison with True is redundant!", R);
+            Error_Msg_N -- CODEFIX
+              ("?comparison with True is redundant!", R);
          end if;
 
          Check_Unset_Reference (L);
@@ -6676,6 +6685,13 @@ package body Sem_Res is
       Arg2 : Node_Id;
 
    begin
+      --  We must preserve the original entity in a generic setting, so that
+      --  the legality of the operation can be verified in an instance.
+
+      if not Expander_Active then
+         return;
+      end if;
+
       Op := Entity (N);
       while Scope (Op) /= Standard_Standard loop
          Op := Homonym (Op);
@@ -7365,7 +7381,7 @@ package body Sem_Res is
 
       elsif Typ = Universal_Integer or else Typ = Any_Modular then
          if Parent_Is_Boolean then
-            Error_Msg_N
+            Error_Msg_N -- CODEFIX???
               ("operand of not must be enclosed in parentheses",
                Right_Opnd (N));
          else
@@ -7387,7 +7403,8 @@ package body Sem_Res is
            and then not Is_Boolean_Type (Typ)
            and then Parent_Is_Boolean
          then
-            Error_Msg_N ("?not expression should be parenthesized here!", N);
+            Error_Msg_N -- CODEFIX???
+              ("?not expression should be parenthesized here!", N);
          end if;
 
          --  Warn on double negation if checking redundant constructs
@@ -7398,7 +7415,8 @@ package body Sem_Res is
            and then Root_Type (Typ) = Standard_Boolean
            and then Nkind (Right_Opnd (N)) = N_Op_Not
          then
-            Error_Msg_N ("redundant double negation?", N);
+            Error_Msg_N -- CODEFIX???
+              ("redundant double negation?", N);
          end if;
 
          --  Complete resolution and evaluation of NOT
@@ -8578,7 +8596,8 @@ package body Sem_Res is
 
                if From_With_Type (Opnd) then
                   Error_Msg_Qual_Level := 99;
-                  Error_Msg_NE ("missing WITH clause on package &", N,
+                  Error_Msg_NE -- CODEFIX
+                    ("missing WITH clause on package &", N,
                     Cunit_Entity (Get_Source_Unit (Base_Type (Opnd))));
                   Error_Msg_N
                     ("type conversions require visibility of the full view",
@@ -8590,7 +8609,8 @@ package body Sem_Res is
                       and then Present (Non_Limited_View (Etype (Target))))
                then
                   Error_Msg_Qual_Level := 99;
-                  Error_Msg_NE ("missing WITH clause on package &", N,
+                  Error_Msg_NE -- CODEFIX
+                    ("missing WITH clause on package &", N,
                     Cunit_Entity (Get_Source_Unit (Base_Type (Target))));
                   Error_Msg_N
                     ("type conversions require visibility of the full view",
@@ -8682,7 +8702,7 @@ package body Sem_Res is
          Determine_Range (Right_Opnd (N), OK, Lo, Hi);
 
          if OK and then Hi >= Lo and then Lo >= 0 then
-            Error_Msg_N
+            Error_Msg_N -- CODEFIX
              ("?abs applied to known non-negative value has no effect", N);
          end if;
       end if;
@@ -8820,7 +8840,7 @@ package body Sem_Res is
 
                --  If we fall through warning should be issued
 
-               Error_Msg_N
+               Error_Msg_N -- CODEFIX???
                  ("?unary minus expression should be parenthesized here!", N);
             end if;
          end if;
@@ -9201,9 +9221,12 @@ package body Sem_Res is
 
       procedure Fixed_Point_Error is
       begin
-         Error_Msg_N ("ambiguous universal_fixed_expression", N);
-         Error_Msg_NE ("\\possible interpretation as}", N, T1);
-         Error_Msg_NE ("\\possible interpretation as}", N, T2);
+         Error_Msg_N -- CODEFIX???
+           ("ambiguous universal_fixed_expression", N);
+         Error_Msg_NE -- CODEFIX???
+            ("\\possible interpretation as}", N, T1);
+         Error_Msg_NE -- CODEFIX???
+            ("\\possible interpretation as}", N, T2);
       end Fixed_Point_Error;
 
    --  Start of processing for Unique_Fixed_Point_Type
@@ -10049,7 +10072,8 @@ package body Sem_Res is
          and then Is_Access_Type (Opnd_Type)
       then
          Error_Msg_N ("target type must be general access type!", N);
-         Error_Msg_NE ("add ALL to }!", N, Target_Type);
+         Error_Msg_NE -- CODEFIX
+            ("add ALL to }!", N, Target_Type);
          return False;
 
       else
This page took 0.050427 seconds and 5 git commands to generate.