diff options
author | Robert Dewar <dewar@adacore.com> | 2010-10-22 13:58:49 +0000 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2010-10-22 15:58:49 +0200 |
commit | 86200f6646bd6f79ce534253da034238ebbf5e10 (patch) | |
tree | 0f29daae91540971a73fc67b6f90224da6b55447 /gcc/ada/sem_attr.adb | |
parent | 497b37aded1f085d996b5bd67ec4c62b26810912 (diff) | |
download | gcc-86200f6646bd6f79ce534253da034238ebbf5e10.zip gcc-86200f6646bd6f79ce534253da034238ebbf5e10.tar.gz gcc-86200f6646bd6f79ce534253da034238ebbf5e10.tar.bz2 |
a-except-2005.adb (Rmsg_18): New message text.
2010-10-22 Robert Dewar <dewar@adacore.com>
* a-except-2005.adb (Rmsg_18): New message text.
* a-except.adb (Rmsg_18): New message text.
* atree.adb (List25): New function
(Set_List25): New procedure
* atree.ads (List25): New function
(Set_List25): New procedure
* einfo.adb (Static_Predicate): Is now a list
(OK_To_Reference): Present in all entities
* einfo.ads (Static_Predicate): Is now a list
(OK_To_Reference): Applies to all entities
* exp_ch13.adb (Build_Predicate_Function): Moved to Sem_Ch13
* sem_attr.adb (Bad_Attribute_For_Predicate): Call
Bad_Predicated_Subtype_Use.
* sem_case.ads, sem_case.adb: Major surgery to deal with predicated
subtype case.
* sem_ch13.adb (Build_Predicate_Function): Moved from Exp_Ch13 to
Sem_Ch13.
(Build_Static_Predicate): New procedure handles static predicates.
* sem_ch3.adb (Analyze_Subtype_Declaration): Delay freeze on subtype
with no constraint if ancestor subtype has predicates.
(Analyze_Variant_Part): New calling sequence for Analyze_Choices
* sem_ch4.adb (Junk_Operand): Don't complain about OK_To_Reference
entity.
(Analyze_Case_Expression): New calling sequence for Analyze_Choices
* sem_ch5.adb (Analyze_Case_Statement): New calling sequence for
Analyze_Choices.
* sem_util.ads, sem_util.adb (Bad_Predicated_Subtype_Use): New procedure
* types.ads (PE_Bad_Predicated_Generic_Type): Replaces
PE_Bad_Attribute_For_Predicate.
* atree.h: Add definition of List25.
From-SVN: r165828
Diffstat (limited to 'gcc/ada/sem_attr.adb')
-rw-r--r-- | gcc/ada/sem_attr.adb | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 0867975..20a7829 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -215,7 +215,8 @@ package body Sem_Attr is -- Output error message for use of a predicate (First, Last, Range) not -- allowed with a type that has predicates. If the type is a generic -- actual, then the message is a warning, and we generate code to raise - -- program error with an appropriate reason. + -- program error with an appropriate reason. No error message is given + -- for internally generated uses of the attributes. procedure Check_Array_Or_Scalar_Type; -- Common procedure used by First, Last, Range attribute to check @@ -838,23 +839,10 @@ package body Sem_Attr is procedure Bad_Attribute_For_Predicate is begin - if Has_Predicates (P_Type) then + if Comes_From_Source (N) then Error_Msg_Name_1 := Aname; - - if Is_Generic_Actual_Type (P_Type) then - Error_Msg_F - ("type& has predicates, attribute % not allowed?", P); - Error_Msg_F - ("\?Program_Error will be raised at run time", P); - Rewrite (N, - Make_Raise_Program_Error (Loc, - Reason => PE_Bad_Attribute_For_Predicate)); - - else - Error_Msg_F - ("type& has predicates, attribute % not allowed", P); - Error_Attr; - end if; + Bad_Predicated_Subtype_Use + (P_Type, N, "type& has predicates, attribute % not allowed"); end if; end Bad_Attribute_For_Predicate; |