(Debian bug #280940) -- RM 3.10(15) "An access value satisfies a composite_constraint -- of an access subtype if it ... designates an object whose value -- satisfies the constraint." with text_io; procedure Test_131 is type string_ptr is access all string; subtype str10 is string_Ptr(1..10); xstr20: aliased string := (1..20 => 'a'); xstr10: str10; begin xstr10 := xstr20'Access; -- line 12 text_io.put_line("FAILED, constraint_error not raised"); exception when constraint_error => text_io.put_line("PASSED, constraint_error raised"); end Test_131; Expected output: the compiler says nothing, the program prints: PASSED, constraint_error raised Actual output with gnat 3.15p: test_131.adb:12:14: object subtype must statically match designated subtype gnatmake: "test_131.adb" compilation error which is incorrect. With gnat-3.4 3.4.2-2, the compiler says nothing (correct) but the program runs and outputs: FAILED, constraint_error not raised
Confirmed.
Fixed on trunk.