[Ada] Finding proper scope when inside entry body
This patch modifies routine Find_Enclosing_Scope which obtains the scope of an
arbitrary node to return the unique defining entity of an enclosing body. This
automatically takes care of the following corner cases:
* The body is a subprogram body which does not complete a previous
declaration. In this case the proper scope is the entity of the
body.
* The body is an entry body. Due to a limitation in the AST, the
entry body does not store its correcponsing spec, but utilizes a
roundabout way of obtaining it. Regardless of the limitation, the
proper scope is the entity of the entry declaration.
The issue was discovered during the development of the GNATprove tool and
is not visible to end users. No simple test is available because this would
require a debug session.
2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
gcc/ada/
* sem_util.adb (Find_Enclosing_Scope): Return the unique defining
entity when the enclosing construct is a body.
From-SVN: r256489