From: Eric Botcazou Date: Thu, 10 Mar 2022 10:11:32 +0000 (+0100) Subject: [Ada] Fix internal error on mix of controlled and protected types X-Git-Tag: basepoints/gcc-14~6723 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=146ea83af978384b0f7dabc8176f8bf98892ce2a;p=thirdparty%2Fgcc.git [Ada] Fix internal error on mix of controlled and protected types The key is that the protected type is a (limited) private type, which fools a test in Cleanup_Scopes. gcc/ada/ * inline.adb (Cleanup_Scopes): Test the underlying type. --- diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb index 5944aed0b00..a1d22544874 100644 --- a/gcc/ada/inline.adb +++ b/gcc/ada/inline.adb @@ -2773,7 +2773,7 @@ package body Inline is Scop := Protected_Body_Subprogram (Scop); elsif Is_Subprogram (Scop) - and then Is_Protected_Type (Scope (Scop)) + and then Is_Protected_Type (Underlying_Type (Scope (Scop))) and then Present (Protected_Body_Subprogram (Scop)) then -- If a protected operation contains an instance, its cleanup