aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/checks.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/checks.adb')
-rw-r--r--gcc/ada/checks.adb11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb
index 2921260..9b10f12 100644
--- a/gcc/ada/checks.adb
+++ b/gcc/ada/checks.adb
@@ -4108,6 +4108,17 @@ package body Checks is
end if;
end if;
+ -- If this is a boolean expression, only its elementary consituents
+ -- need checking: if they are valid, a boolean or short-circuit
+ -- operation with them will be valid as well.
+
+ if Base_Type (Typ) = Standard_Boolean
+ and then
+ (Nkind (Expr) in N_Op or else Nkind (Expr) in N_Short_Circuit)
+ then
+ return;
+ end if;
+
-- If we fall through, a validity check is required
Insert_Valid_Check (Expr);