| | 1186 | ---------------------------- |
|---|
| | 1187 | -- Is_Universal_Access_Eq -- |
|---|
| | 1188 | ---------------------------- |
|---|
| | 1189 | |
|---|
| | 1190 | function Is_Universal_Access_Eq (Op : Asis.Declaration) return Boolean is |
|---|
| | 1191 | Name : constant Asis.Defining_Name := Asis.Declarations.Names (Op)(1); |
|---|
| | 1192 | Tipe : Asis.Definition; |
|---|
| | 1193 | Decl : Asis.Declaration; |
|---|
| | 1194 | begin |
|---|
| | 1195 | if Defining_Name_Kind (Name) = A_Defining_Operator_Symbol and then |
|---|
| | 1196 | Is_Part_Of_Implicit (Op) |
|---|
| | 1197 | then |
|---|
| | 1198 | Tipe := Asis.Declarations.Corresponding_Type (Op); |
|---|
| | 1199 | Decl := Enclosing_Element (Tipe); |
|---|
| | 1200 | |
|---|
| | 1201 | return Is_Equal (Decl, XASIS.Types.Universal_Access); |
|---|
| | 1202 | end if; |
|---|
| | 1203 | |
|---|
| | 1204 | return False; |
|---|
| | 1205 | end Is_Universal_Access_Eq; |
|---|
| | 1206 | |
|---|
| | 1207 | function Check_Universal_Access_Eq -- ARM 4.5.2 (9.1/2) |
|---|
| | 1208 | (Name : Up_Interpretation) return Boolean |
|---|
| | 1209 | is |
|---|
| | 1210 | begin |
|---|
| | 1211 | if Name.Kind /= A_Declaration or else |
|---|
| | 1212 | not Is_Universal_Access_Eq (Name.Declaration) |
|---|
| | 1213 | then |
|---|
| | 1214 | return True; |
|---|
| | 1215 | end if; |
|---|
| | 1216 | |
|---|
| | 1217 | if not Is_Anonymous_Access (Stored.Real_Types (1)) |
|---|
| | 1218 | and then not Is_Anonymous_Access (Stored.Real_Types (2)) |
|---|
| | 1219 | then |
|---|
| | 1220 | return False; |
|---|
| | 1221 | end if; |
|---|
| | 1222 | |
|---|
| | 1223 | if Is_Expanded_Name (Asis.Expressions.Prefix (Element)) then |
|---|
| | 1224 | return True; |
|---|
| | 1225 | end if; |
|---|
| | 1226 | |
|---|
| | 1227 | -- TODO rest of rule |
|---|
| | 1228 | return True; |
|---|
| | 1229 | end Check_Universal_Access_Eq; |
|---|
| | 1230 | |
|---|