------- Comment #6 from ludovic at ludovic-brenta dot org 2008-04-24 09:55 ------- (In reply to comment #4)
Anh Vo, you are perfectly right up to a point: Pak1.Eq returns True and Pak2.Eq returns False, therefore comparing the two results yields False. Where you are wrong is where you think Pak2.Eq is correct in returning False. This is the bug. Pak2.Eq should return True. To explain another way: ARM 3.4(27) defines precisely the behaviour of a call to an inherited subprogram. Pak2.Eq is inherited and not overridden, so 3.4(27) applies. Per ARM 3.4(27), calling Pak2.Eq (Z1, Z2) is by definition equivalent to calling Pak1.Eq (Pak1.T1 (Z1), Pak1.T1 (Z2)) Therefore the two calls must yield the same result (i.e. True). The test case shows clearly that this is not the case, i.e. GNAT has a bug. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32181