aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/Make-lang.in
diff options
context:
space:
mode:
authorEd Schonberg <schonberg@adacore.com>2018-09-26 09:17:16 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2018-09-26 09:17:16 +0000
commitbcbe14db192f03018ea74cf6eb24c04a110ecac0 (patch)
tree6f0259bd94fa7634186de098bbb969e0fec3564d /gcc/ada/gcc-interface/Make-lang.in
parent4453a8221c65f386ae361670fa932643521374d7 (diff)
downloadgcc-bcbe14db192f03018ea74cf6eb24c04a110ecac0.zip
gcc-bcbe14db192f03018ea74cf6eb24c04a110ecac0.tar.gz
gcc-bcbe14db192f03018ea74cf6eb24c04a110ecac0.tar.bz2
[Ada] Missing predicate check on return value
The semantics of the return statement includes an implicit conversion of the value to the return type of the funcction. This conversion, as elsewhere, entails a predicate check if the return type has a predicate aspect. We do not apply the check to a case expression because in the context of a return statement it will be expanded into a series of return statements, each of which will receive a predicate check. 2018-09-26 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * sem_ch6.adb (Analyze_Function_Return): If the return type has a dynamic_predicate, apply a Predicate_Check to the expression, given that it is implicitly converted to the return type. Exclude case expressions from the check, because in this context the expression is expanded into individual return statements. gcc/testsuite/ * gnat.dg/predicate3.adb, gnat.dg/predicate3_pkg.ads: New testcase. From-SVN: r264611
Diffstat (limited to 'gcc/ada/gcc-interface/Make-lang.in')
0 files changed, 0 insertions, 0 deletions