aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/interface.c
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2018-06-11 09:17:51 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2018-06-11 09:17:51 +0000
commitf062a9757ac2d2cf368f1a0d82fedac54ca365fb (patch)
tree4271aca4b3aa089d1fb1f075ec3f762399afdc78 /gcc/fortran/interface.c
parentacc257bbf0fe5cc6560d8fe1607d1be64528a96f (diff)
downloadgcc-f062a9757ac2d2cf368f1a0d82fedac54ca365fb.zip
gcc-f062a9757ac2d2cf368f1a0d82fedac54ca365fb.tar.gz
gcc-f062a9757ac2d2cf368f1a0d82fedac54ca365fb.tar.bz2
[Ada] Fix handling of Pre/Post contracts with AND THEN expressions
Pre- and postconditions with top-level AND THEN expressions are broken down into checks of indivudial conjuncts for more precise error reporting. This rewrite interfers with detection of potentially unevaluadted use of 'Old, e.g. a contract like "Pre => Foo and then Bar" is rewritten into a two pragmas Check, for expressions "Foo" and "Bar", but the latter remains potentially unevaluted. This patch fixes detection of the AND THEN rewrite. This fixes inlining in the GNATprove mode, i.e. the following testc case must not emit a warning like: contract1.adb:14:07: info: no contextual analysis of "Foo" (in potentially unevaluated context) 2018-06-11 Piotr Trojanek <trojanek@adacore.com> gcc/ada/ * sem_util.adb (Is_Potentially_Unevaluated): Fix detection of contracts with AND THEN expressions broken down into individual conjuncts. gcc/testsuite/ * gnat.dg/contract1.adb: New testcase. From-SVN: r261410
Diffstat (limited to 'gcc/fortran/interface.c')
0 files changed, 0 insertions, 0 deletions