The following calls to predefined operators in Standard are all illegal but the compiler only rejects 3 of them:
package pak1 is type my_Int is new integer; x1: my_int; x2: my_int := standard."mod" (x1, 2); x3: my_int := standard."rem" (x1, 2); x4: my_int := standard."abs" (x1); -- line 7 x5: my_int := standard."+" (x1, 2); x6: my_int := standard."-" (x1, 2); x7: my_int := standard."*" (x1, 2); x8: my_int := standard."/" (x1, 2); x9: my_int := standard."+" (x1); -- line 12 x10: my_int := standard."-" (x1); -- line 13 end pak1; gcc-4.3 -c pak1.ads pak1.ads:7:26: "abs" not declared in "Standard" pak1.ads:12:26: "+" not declared in "Standard" pak1.ads:13:27: "-" not declared in "Standard" gcc-4.4 -c pak1.ads pak1.ads:7:26: "abs" not declared in "Standard" pak1.ads:12:26: "+" not declared in "Standard" pak1.ads:13:27: "-" not declared in "Standard" It seems that, for all operators that take two operands, GCC silently (and wrongly) converts x1 to its parent type, Integer. This does not happen for unary operators. -- Summary: Illegal program accepted, applying predefined operators of Integer on a derived type Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ada AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: ludovic at ludovic-brenta dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40933