This patch allows the compiler to report an error on Bit_Order when
defined for a record extension.
2018-07-16 Javier Miranda <miranda@adacore.com>
gcc/ada/
* sem_ch13.adb (Analyze_Attribute_Definition_Clause): Report an error
on Bit_Order when defined for a record extension.
gcc/testsuite/
* gnat.dg/bit_order1.adb: New testcase.
From-SVN: r262712
+2018-07-16 Javier Miranda <miranda@adacore.com>
+
+ * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Report an error
+ on Bit_Order when defined for a record extension.
+
2018-07-16 Arnaud Charlet <charlet@adacore.com>
* libgnat/s-objrea.ads: Minor code clean up.
Error_Msg_N
("Bit_Order can only be defined for record type", Nam);
+ elsif Is_Tagged_Type (U_Ent)
+ and then Is_Derived_Type (U_Ent)
+ then
+ Error_Msg_N
+ ("Bit_Order cannot be defined for record extensions", Nam);
+
elsif Duplicate_Clause then
null;
+2018-07-16 Javier Miranda <miranda@adacore.com>
+
+ * gnat.dg/bit_order1.adb: New testcase.
+
2018-07-16 Javier Miranda <miranda@adacore.com>
* gnat.dg/iter2.adb, gnat.dg/iter2.ads: New testcase.
--- /dev/null
+-- { dg-do compile }
+
+with System;
+
+procedure Bit_Order1 is
+
+ type Sample_Ttype is tagged record
+ Data : Natural;
+ end record;
+
+ type Other_Type is new Sample_Ttype with record
+ Other_Data : String (1 .. 100);
+ end record;
+
+ for Other_Type'Bit_Order use System.High_Order_First; -- { dg-error "Bit_Order cannot be defined for record extensions" }
+begin
+ null;
+end;