From: Arnaud Charlet Date: Wed, 7 Jan 2015 09:31:05 +0000 (+0100) Subject: [multiple changes] X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7d1286f61e043074327839d3f2cd1c8d0039c3dc;p=gcc.git [multiple changes] 2015-01-07 Robert Dewar * sem_ch3.adb: Minor error message change. 2015-01-07 Ed Schonberg * sem_prag.adb (Analyze_Pragma, case Preelaborable_Initialization): Following AI05-028, the pragam applies legally to any composite type. From-SVN: r219285 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 03edfd042d1..6a752d25829 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,12 @@ +2015-01-07 Robert Dewar + + * sem_ch3.adb: Minor error message change. + +2015-01-07 Ed Schonberg + + * sem_prag.adb (Analyze_Pragma, case Preelaborable_Initialization): + Following AI05-028, the pragam applies legally to any composite type. + 2015-01-07 Arnaud Charlet * s-osinte-vxworks.adb, s-osinte-vxworks.ads diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 51083e37f92..ac52f08aeb9 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -18981,9 +18981,8 @@ package body Sem_Ch3 is elsif Present (Expression (Discr)) then Error_Msg_N - ("(Ada 2005) access discriminants of nonlimited types", - Expression (Discr)); - Error_Msg_N ("\cannot have defaults", Expression (Discr)); + ("(Ada 2005) access discriminants of nonlimited types " + & "cannot have defaults", Expression (Discr)); end if; end if; end if; diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 59a54ee332c..acae793f17c 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -17839,17 +17839,25 @@ package body Sem_Prag is then null; + -- Check appropriate type argument + elsif Is_Private_Type (Ent) or else Is_Protected_Type (Ent) or else (Is_Generic_Type (Ent) and then Is_Derived_Type (Ent)) + + -- AI05-0028: The pragma applies to all composite types. Note + -- that we apply this binding intepretation to previous verions + -- of Ada so there is no Ada 2012 guard. Seems a reasonable + -- choice since there are other compilers that do the same. + + or else Is_Composite_Type (Ent) then null; else Error_Pragma_Arg - ("pragma % can only be applied to private, formal derived or " - & "protected type", - Arg1); + ("pragma % can only be applied to private, formal derived, " + & "protected, or composite type", Arg1); end if; -- Give an error if the pragma is applied to a protected type that