public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/autopar_devel] [Ada] Fix wrong type being used for range check generation
@ 2020-08-22 22:15 Giuliano Belinassi
  0 siblings, 0 replies; only message in thread
From: Giuliano Belinassi @ 2020-08-22 22:15 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:74c9b33344252a9c5d1e13eb01313dd7a2bf9ae5

commit 74c9b33344252a9c5d1e13eb01313dd7a2bf9ae5
Author: Ghjuvan Lacambre <lacambre@adacore.com>
Date:   Fri Feb 28 14:56:31 2020 +0100

    [Ada] Fix wrong type being used for range check generation
    
    2020-06-09  Ghjuvan Lacambre  <lacambre@adacore.com>
    
    gcc/ada/
    
            * sem_res.adb (Resolve_Qualified_Expression): Use Subtype_Mark
            type.

Diff:
---
 gcc/ada/sem_res.adb | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index 6e26ffb3c45..15d08fee4fc 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -10004,8 +10004,10 @@ package body Sem_Res is
       --  check may convert an illegal static expression and result in warning
       --  rather than giving an error (e.g Integer'(Integer'Last + 1)).
 
-      if Nkind (N) = N_Qualified_Expression and then Is_Scalar_Type (Typ) then
-         Apply_Scalar_Range_Check (Expr, Typ);
+      if Nkind (N) = N_Qualified_Expression
+        and then Is_Scalar_Type (Target_Typ)
+      then
+         Apply_Scalar_Range_Check (Expr, Target_Typ);
       end if;
 
       --  AI12-0100: Once the qualified expression is resolved, check whether


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-08-22 22:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-22 22:15 [gcc/devel/autopar_devel] [Ada] Fix wrong type being used for range check generation Giuliano Belinassi

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).