public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-356] [Ada] Accept raise expressions as operands of boolean operators
@ 2022-05-12 12:40 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2022-05-12 12:40 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:c97014ce88150584689a2ae9a95d8a40115e0423

commit r13-356-gc97014ce88150584689a2ae9a95d8a40115e0423
Author: Piotr Trojanek <trojanek@adacore.com>
Date:   Wed Feb 9 17:15:27 2022 +0100

    [Ada] Accept raise expressions as operands of boolean operators
    
    This patch restores the previous behaviour of a recently rewritten
    routine Sem_Ch4.Find_Boolean_Types for boolean operators where one of
    the operands is a raise-expression, e.g.:
    
      (raise Program_Error or else (X /= Y))
    
    This change is required for the Entity field of the "or else" operator
    to be set. For GNAT it doesn't matter, but GNATprove requires this field
    to be set.
    
    The affected call sequence starts at Find_Boolean_Types, goes via
    Check_Right_Argument and Check_Boolean_Pair to Valid_Boolean_Arg, which
    ultimately guards a call to Add_One_Interp.
    
    gcc/ada/
    
            * sem_type.adb (Valid_Boolean_Arg): Operands of Raise_Type are
            valid boolean arguments.

Diff:
---
 gcc/ada/sem_type.adb | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gcc/ada/sem_type.adb b/gcc/ada/sem_type.adb
index 4476ea970e9..e947296c9a2 100644
--- a/gcc/ada/sem_type.adb
+++ b/gcc/ada/sem_type.adb
@@ -3507,6 +3507,7 @@ package body Sem_Type is
         or else Is_Modular_Integer_Type (T)
         or else T = Universal_Integer
         or else T = Any_Composite
+        or else T = Raise_Type
       then
          return True;


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

only message in thread, other threads:[~2022-05-12 12:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-12 12:40 [gcc r13-356] [Ada] Accept raise expressions as operands of boolean operators Pierre-Marie de Rodat

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