From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7871) id DF2A23858C78; Mon, 7 Nov 2022 08:38:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DF2A23858C78 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1667810316; bh=xY3AEheh+vn1j5rkquXbaPF+zHHE6U2NvyGVIifgLEI=; h=From:To:Subject:Date:From; b=gcgwfDm+AhT+0Vcuz2aoQdovuayQI2Smgswnds1/JjbNh/GlUzKrz+/mI67exQGhz +Oeh8PFvC8A7GO9tS7xcQeC8JdPGOj43EE4x2eT2t6pN8ZLyGfvVa8BFoqqC30lGlK Weeaot4P38hfPYWosfeEGzA6d/mQs4KFmBTrc6lo= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Marc Poulhi?s To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-3725] ada: Put_Image aspect spec incorrectly not inherited X-Act-Checkin: gcc X-Git-Author: Steve Baird X-Git-Refname: refs/heads/master X-Git-Oldrev: ae3952715ce92cb6baac6d2b883c9a29a70cb1d9 X-Git-Newrev: 748976cfc867cb387f0f8180c48233e883223f93 Message-Id: <20221107083836.DF2A23858C78@sourceware.org> Date: Mon, 7 Nov 2022 08:38:36 +0000 (GMT) List-Id: https://gcc.gnu.org/g:748976cfc867cb387f0f8180c48233e883223f93 commit r13-3725-g748976cfc867cb387f0f8180c48233e883223f93 Author: Steve Baird Date: Tue Oct 11 15:21:39 2022 -0700 ada: Put_Image aspect spec incorrectly not inherited In some cases, a Put_Image aspect specification for a scalar type was not correctly inherited by a descendant of that type. gcc/ada/ * exp_put_image.adb (Image_Should_Call_Put_Image): Correctly handle the case of an inherited Put_Image aspect specification for a scalar type. Diff: --- gcc/ada/exp_put_image.adb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/ada/exp_put_image.adb b/gcc/ada/exp_put_image.adb index 50e0569a801..c489ad41fd1 100644 --- a/gcc/ada/exp_put_image.adb +++ b/gcc/ada/exp_put_image.adb @@ -1039,13 +1039,13 @@ package body Exp_Put_Image is end if; -- In Ada 2022, T'Image calls T'Put_Image if there is an explicit - -- aspect_specification for Put_Image, or if U_Type'Image is illegal - -- in pre-2022 versions of Ada. + -- (or inherited) aspect_specification for Put_Image, or if + -- U_Type'Image is illegal in pre-2022 versions of Ada. declare U_Type : constant Entity_Id := Underlying_Type (Entity (Prefix (N))); begin - if Present (TSS (U_Type, TSS_Put_Image)) then + if Present (Find_Aspect (U_Type, Aspect_Put_Image)) then return True; end if;