This is Debian bug #274077, with a different title because GCC 3.4.2 and GNAT 3.15p give different symptoms. with text_io; procedure Test_120 is protected type pt1 is function f3 return integer; -- overloaded function f4 return integer; -- not overloaded end pt1; protected body pt1 is function f3 return integer is begin return 1; end; function f4 return integer is begin return 2; end; end pt1; protected type pt2 is function f3 return float; end pt2; protected body pt2 is function f3 return float is begin return 0.0; end; end pt2; type pt1_acc is access all pt1; type pt2_acc is access all pt2; x1: aliased pt1; x2: aliased pt2; function f1 return pt1_acc is begin return x1'access; end; function f1 return pt2_acc is begin return x2'access; end; begin text_io.put_line(integer'image(f1.all.f4)); text_io.put_line(integer'image(f1.f4)); text_io.put_line(integer'image(f1.all.f3)); text_io.put_line(integer'image(f1.f3)); -- should allow implicit .all end Test_120; GCC 3.4.2 gives: test_120.adb:34:35: access type required in prefix of explicit dereference gnatmake: "test_120.adb" compilation error which is incorrect; the three lines above demonstrate correct behaviour. GNAT 3.15p gives a bug box: +===========================GNAT BUG DETECTED==============================+ | 3.15p (20020523) (i486-pc-linux-gnu) Program_Error sem_type.adb:1348 explicit raise| | Error detected at test_120.adb:34:37 | -- Ludovic Brenta.
Confirmed.
This appears to be fixed in SVN trunk and GCC 4.3.1.