-- 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,
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;
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;
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;
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 ???
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);
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
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
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
-- 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);
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,
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);
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);
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
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
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
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",
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",
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;
-- 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;
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
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