[Ada] Spurious error on synchronous refinement
authorHristian Kirtchev <kirtchev@adacore.com>
Mon, 21 May 2018 14:50:54 +0000 (14:50 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Mon, 21 May 2018 14:50:54 +0000 (14:50 +0000)
commitbcc093dc813c77d15a8d99ce063a45fa01c7ed73
treea9d3f2895c70c51b3be1ee03dceb19217a0e3d95
parentfe44c442e4c83f3280a72e917c418c6e6129cba7
[Ada] Spurious error on synchronous refinement

This patch ensures that an abstract state declared with simple option
"synchronous" is automatically considered "external".

2018-05-21  Hristian Kirtchev  <kirtchev@adacore.com>

gcc/ada/

* einfo.adb (Is_External_State): An abstract state is also external
when it is declared with option "synchronous".
* einfo.ads: Update the documentation of synthesized attribute
Is_External_State.
* sem_util.adb (Find_Simple_Properties): New routine.
(Is_Enabled_External_Property): New routine.
(State_Has_Enabled_Property): Reimplemented. The two flavors of option
External have precedence over option Synchronous when determining
whether a property is in effect.

gcc/testsuite/

* gnat.dg/sync2.adb, gnat.dg/sync2.ads: New testcase.

From-SVN: r260453
gcc/ada/ChangeLog
gcc/ada/einfo.adb
gcc/ada/einfo.ads
gcc/ada/sem_util.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/sync2.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/sync2.ads [new file with mode: 0644]