public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "jakub.s7920 at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug ada/107309] New: GNAT does not apply type conversion rules to dependent expressions of conditional expressions Date: Tue, 18 Oct 2022 19:21:15 +0000 [thread overview] Message-ID: <bug-107309-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107309 Bug ID: 107309 Summary: GNAT does not apply type conversion rules to dependent expressions of conditional expressions Product: gcc Version: 12.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ada Assignee: unassigned at gcc dot gnu.org Reporter: jakub.s7920 at gmail dot com Target Milestone: --- Created attachment 53726 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53726&action=edit if / case expression example According to AARM 4.5.7 (10/3), if the conditional expression is an argument of a type conversion then said conversion should apply to each of the dependent expressions. I tried compiling an example taken straight from AARM on GNAT 12.1.0 and GNAT 10.3.0 but got the following error message: > $ gnat make if_exp.adb > x86_64-linux-gnu-gcc-12 -c if_exp.adb > if_exp.adb:5:34: error: expected an integer type > if_exp.adb:5:34: error: found type universal real > x86_64-linux-gnu-gnatmake-12: "if_exp.adb" compilation error Similar results with an equivalent case expression: > $ gnat make case_exp.adb > x86_64-linux-gnu-gcc-12 -c case_exp.adb > case_exp.adb:7:30: error: expected type universal integer > case_exp.adb:7:30: error: found type universal real > x86_64-linux-gnu-gnatmake-12: "case_exp.adb" compilation error I've attached the source code of both files. The commented out code is, to my understanding, semantically the same as the corresponding version that doesn't compile. http://www.ada-auth.org/standards/12rat/html/Rat12-3-2.html http://www.ada-auth.org/standards/aarm12_w_tc1/html/AA-4-5-7.html
next reply other threads:[~2022-10-18 19:21 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-10-18 19:21 jakub.s7920 at gmail dot com [this message] 2022-10-22 11:12 ` [Bug ada/107309] GNAT does not apply type conversion " ebotcazou at gcc dot gnu.org 2022-10-22 11:13 ` ebotcazou at gcc dot gnu.org 2022-11-08 10:22 ` ebotcazou at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-107309-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).