[Ada] Missing accessibility checks on conditionals
authorJustin Squirek <squirek@adacore.com>
Fri, 13 Dec 2019 09:03:28 +0000 (09:03 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Fri, 13 Dec 2019 09:03:28 +0000 (09:03 +0000)
commit8daf00dd4a654c807618b01f92aac75e7842be13
tree9bf4e382c38d88188450606e4a738071f4323aeb
parentd7c37f454912c398302679e780ff69c76a3f843a
[Ada] Missing accessibility checks on conditionals

2019-12-13  Justin Squirek  <squirek@adacore.com>

gcc/ada/

* sem_res.adb (Resolve_Allocator): Add calls to
Check_Cond_Expr_Accessibility when a conditional expression is
found.
(Check_Allocator_Discrim_Accessibility_Exprs): Created to
recursively traverse a potentially compound conditional
expression and perform accessibility checks for each
alternative.
* sem_util.adb (Dynamic_Accessibility_Level): Avoid use of
original node of the expression in question so we can handle
dynamic accessibility in the limited case of a constant folded
conditional expression.

From-SVN: r279342
gcc/ada/ChangeLog
gcc/ada/sem_res.adb
gcc/ada/sem_util.adb