Skip to content

Commit

Permalink
Merge branch 'topic/1303' into 'master'
Browse files Browse the repository at this point in the history
Add support for the Preelaborable_Initialization attribute

Closes #1303

See merge request eng/libadalang/libadalang!1561
  • Loading branch information
thvnx committed Mar 11, 2024
2 parents ed6233b + 267c45a commit 95b3a5b
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ada/ast.py
Original file line number Diff line number Diff line change
Expand Up @@ -20586,7 +20586,8 @@ def xref_equation():
'Has_Tagged_Values', 'Definite', 'Constrained',
'Initialized', 'Valid_Scalars',
'Unconstrained_Array', 'Library_Level',
'Denorm', 'Signed_Zeros'),
'Denorm', 'Signed_Zeros',
'Preelaborable_Initialization'),
Entity.prefix.sub_equation
& Bind(Self.type_var, Self.bool_type),

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-- Test for the Preelaborable aspect/attribute name resolution

procedure Test is
type T is new Integer;

type U is new T with
Preelaborable_Initializaton => T'Preelaborable_Initialization;
pragma Test_Block;
begin
null;
end Test;
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Analyzing test.adb
##################

Resolving xrefs for node <AspectAssoc test.adb:7:7-7:68>
********************************************************

Expr: <Id "Preelaborable_Initializaton" test.adb:7:7-7:34>
references: None
type: None
expected type: None
Expr: <AttributeRef test.adb:7:38-7:68>
references: None
type: <ConcreteTypeDecl ["Boolean"] __standard:3:3-3:33>
expected type: None
Expr: <Id "T" test.adb:7:38-7:39>
references: <DefiningName "T" test.adb:4:9-4:10>
type: <ConcreteTypeDecl ["T"] test.adb:4:4-4:26>
expected type: None
Expr: <Id "Preelaborable_Initialization" test.adb:7:40-7:68>
references: None
type: None
expected type: None


Done.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
driver: name-resolution
input_sources: [test.adb]

0 comments on commit 95b3a5b

Please sign in to comment.