diff --git a/ada/nodes.lkt b/ada/nodes.lkt index e4e191bcd..fda7b05ce 100644 --- a/ada/nodes.lkt +++ b/ada/nodes.lkt @@ -12647,7 +12647,13 @@ class AttributeRef: Name { elif rel_name == s"Result" then self.result_attr_equation() elif rel_name in s"Old" | s"Loop_Entry" then self.bind_to_prefix_eq() elif rel_name in s"Class" | s"Base" then self.prefix.sub_equation() - elif rel_name in s"Valid" | s"Machine_Overflows" | s"Machine_Rounds" | s"Has_Access_Values" | s"Has_Discriminants" | s"Has_Tagged_Values" | s"Definite" | s"Constrained" | s"Initialized" | s"Valid_Scalars" | s"Unconstrained_Array" | s"Library_Level" | s"Preelaborable_Initialization" | s"Denorm" | s"Signed_Zeros" | s"Fast_Math" then self.prefix.sub_equation() and %eq(node.type_var(), node.bool_type()) + elif rel_name in s"Valid" | s"Machine_Overflows" | s"Machine_Rounds" + | s"Has_Access_Values" | s"Has_Discriminants" | s"Has_Tagged_Values" + | s"Definite" | s"Constrained" | s"Initialized" | s"Valid_Scalars" + | s"Unconstrained_Array" | s"Library_Level" + | s"Preelaborable_Initialization" | s"Denorm" | s"Signed_Zeros" + | s"Fast_Math" | s"Passed_By_Reference" then + self.prefix.sub_equation() and %eq(node.type_var(), node.bool_type()) # In the case of the ``Enabled`` attribute, the prefix is supposed # to be a check name, so it's not even an entity that has source # existence. In that case, we just bind the type of the expr to diff --git a/testsuite/tests/name_resolution/passed_by_reference_attr/test.adb b/testsuite/tests/name_resolution/passed_by_reference_attr/test.adb new file mode 100644 index 000000000..080a3b891 --- /dev/null +++ b/testsuite/tests/name_resolution/passed_by_reference_attr/test.adb @@ -0,0 +1,6 @@ +procedure Test is + B : Boolean := Integer'Passed_By_Reference; + pragma Test_Statement; +begin + null; +end; diff --git a/testsuite/tests/name_resolution/passed_by_reference_attr/test.out b/testsuite/tests/name_resolution/passed_by_reference_attr/test.out new file mode 100644 index 000000000..c73260860 --- /dev/null +++ b/testsuite/tests/name_resolution/passed_by_reference_attr/test.out @@ -0,0 +1,25 @@ +Analyzing test.adb +################## + +Resolving xrefs for node +************************************************************* + +Expr: + references: + type: None + expected type: None +Expr: + references: None + type: + expected type: +Expr: + references: + type: + expected type: None +Expr: + references: None + type: None + expected type: None + + +Done. diff --git a/testsuite/tests/name_resolution/passed_by_reference_attr/test.yaml b/testsuite/tests/name_resolution/passed_by_reference_attr/test.yaml new file mode 100644 index 000000000..173e325ff --- /dev/null +++ b/testsuite/tests/name_resolution/passed_by_reference_attr/test.yaml @@ -0,0 +1,2 @@ +driver: name-resolution +input_sources: [test.adb]