Skip to content

Conversation

@MartinClochardPro
Copy link

No description provided.

Comment on lines +69 to +70
reference. (visibility as defined by Ada RM is not strict enough,
as ``statement_identifier`` are implicitly declared in innermost declare block)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you give an example to illustrate this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To my understanding this means that something like

X := 1;
<<My_Label>>
X := 2;
declare
   Y : Integer := 0;
begin
   pragma Assert ((X-1)'At (My_Label) = Y);
end;

is not allowed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A label is declared in the innermost declare block enclosing the label. So this would be legal.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few lines below: "Furthermore, the statement_identifier referenced by an 'At attribute and the attribute itself shall have the same innermost enclosing body."

To my understanding, this would make it illegal as <<My_Label>> and (X-1)'At (My_Label) do not have the same innermost enclosing body.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enclosing body is not the same as enclosing declare block. A "body" refers to a function, procedure, task, or package body.

a constant at a non-visible (or following) labels. The equivalence also
means that the scope of the constant is the surrounding sequence of
statements of the label. In particular, associated finalization will
occurr at the end of the sequence, rather than immediately after the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: "occurr" -> "occur" (there are two similar ones below).

```

That equivalence implies that it is not allowed to refer to the value of
a constant at a non-visible (or following) labels. The equivalence also

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: "label"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants