[Ada] Spurious error on legal synchronized constituent
This patch corrects the predicate which determines whether an entity denotes a
synchronized object as per SPARK RM 9.1. to account for a case where the object
is not atomic, but its type is.
The patch also cleans up various atomic object-related predicates.
2018-05-30 Hristian Kirtchev <kirtchev@adacore.com>
gcc/ada/
* sem_util.adb (Is_Atomic_Object): Cleaned up. Split the entity logic
in a separate routine.
(Is_Atomic_Object_Entity): New routine.
(Is_Atomic_Prefix): Cleaned up.
(Is_Synchronized_Object): Check that the object is atomic, or its type
is atomic.
(Object_Has_Atomic_Components): Removed.
* sem_util.ads (Is_Atomic_Object): Reword the comment on usage.
(Is_Atomic_Object_Entity): New routine.
gcc/testsuite/
* gnat.dg/synchronized1.adb, gnat.dg/synchronized1.ads: New testcase.
From-SVN: r260933