...of derived real type. It comes from an unexpected internal adjustment.
gcc/ada/
PR ada/118712
* sem_warn.adb (Check_References): Deal with small adjustments of
references.
gcc/testsuite/
* gnat.dg/warn33.adb: New test.
* gnat.dg/warn33_pkg.ads: New helper.
UR := Unset_Reference (E1);
end if;
+ -- Protect again small adjustments of reference
+
+ UR := Unqual_Conv (UR);
+
-- Special processing for access types
if Present (UR) and then Is_Access_Type (E1T) then
--- /dev/null
+-- { dg-do compile }
+
+with Warn33_Pkg; use Warn33_Pkg;
+
+procedure Warn33 is
+ Var : DerT;
+begin
+ Var := 1.0 - Var; -- { dg-warning "may be referenced before" }
+end;
--- /dev/null
+package Warn33_Pkg is
+
+ type GenT is delta 1.0 range 1.0 .. 10.0;
+ function "-" (X : GenT; Y : GenT) return GenT;
+ type DerT is new GenT;
+
+end Warn33_Pkg;