r260444 - in /trunk/gcc/ada: ChangeLog sem_attr...
pmderodat@gcc.gnu.org
pmderodat@gcc.gnu.org
Mon May 21 14:50:00 GMT 2018
Author: pmderodat
Date: Mon May 21 14:50:06 2018
New Revision: 260444
URL: https://gcc.gnu.org/viewcvs?rev=260444&root=gcc&view=rev
Log:
[Ada] Extend legality of Scalar_Storage_Order to formal types
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.
Modified:
trunk/gcc/ada/ChangeLog
trunk/gcc/ada/sem_attr.adb
More information about the Gcc-cvs
mailing list