sem_attr.adb
397 KB
-
[Ada] Extend legality of Scalar_Storage_Order to formal types · 8b55e70d
This patch extends the legality of the GNAT attribute Scalar_Storage_Order, to apply to formal private types. Previously this extension applied only in GNAT_Mode, to support instantiations of Ada.Sequential_IO, but it is more generally useful. The following must compile quietly: ---- with Memory_View_Generic; procedure Main is type T is array (1..10) of integer; package OK is new Memory_View_Generic (T); type T2 is new Long_Float; package Wrong is new Memory_View_Generic (T2); begin null; end; ---- with System; generic type Source_Type is private; package Memory_View_Generic is -- various declarations ... SSO : System.Bit_Order := Source_Type'Scalar_Storage_Order; end Memory_View_Generic; 2018-05-21 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * sem_attr.adb (Analyze_Attribute, case Scalar_Storage_Order): The attribute reference is legal within a generic unit when the prefix is a formal private type. From-SVN: r260444
Ed Schonberg committed