diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2013-09-10 17:21:28 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2013-09-10 17:21:28 +0200 |
commit | fb620b37dec4b0c1e9855a59a0c4dfa28fb58d01 (patch) | |
tree | 2aa1248d70e80464bb18ab1104c8321f79d18735 /gcc/ada/sem_ch3.adb | |
parent | ac4018917999464e601b2e675ac326cbbf0044da (diff) | |
download | gcc-fb620b37dec4b0c1e9855a59a0c4dfa28fb58d01.zip gcc-fb620b37dec4b0c1e9855a59a0c4dfa28fb58d01.tar.gz gcc-fb620b37dec4b0c1e9855a59a0c4dfa28fb58d01.tar.bz2 |
[multiple changes]
2013-09-10 Robert Dewar <dewar@adacore.com>
* sinput.adb (Check_For_BOM): Avoid reading past end of file.
2013-09-10 Robert Dewar <dewar@adacore.com>
* errout.adb (Error_Msg_Ada_2012_Feature): New procedure.
* errout.ads (Error_Msg_Ada_2012_Feature): New procedure.
* inline.ads: Save/Restore Ada_Version_Pragma.
* opt.adb: Save/Restore Ada_Version_Pragma.
* opt.ads (Ada_Version_Pragma): New variable.
* par-ch11.adb, par-ch12.adb, par-ch13.adb, par-ch4.adb, par-ch5.adb,
par-ch6.adb, par-ch8.adb, par-prag.adb: Use Error_Msg_Ada_2012_Feature.
* prj.adb: Initialize Ada_Version_Pragma.
* sem_attr.adb: Use Error_Msg_Ada_2012_Feature.
* sem_ch12.adb, sem_ch8.adb: Save/restore Ada_Version_Pragma.
* sem_prag.adb (Analyze_Pragma, cases Ada_xx): Set Ada_Version_Pragma.
* switch-c.adb: Initialize Ada_Version_Pragma.
* sem_ch12.adb: Minor reformatting.
2013-09-10 Ed Schonberg <schonberg@adacore.com>
* sem_ch3.adb (Process_Subtype): Discard constraint on access
to class-wide type. Such constraints are not supported and are
considered a language pathology.
From-SVN: r202466
Diffstat (limited to 'gcc/ada/sem_ch3.adb')
-rw-r--r-- | gcc/ada/sem_ch3.adb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index b3f99c4..2d8d5f7 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -19043,6 +19043,27 @@ package body Sem_Ch3 is case Ekind (Base_Type (Subtype_Mark_Id)) is when Access_Kind => + + -- If this is a constraint on a class-wide type, discard it. + -- There is currently no way to express a partial discriminant + -- constraint on a type with unknown discriminants. This is + -- a pathology that the ACATS wisely decides not to test. + + if Is_Class_Wide_Type (Designated_Type (Subtype_Mark_Id)) then + if Comes_From_Source (S) then + Error_Msg_N + ("constraint on class-wide type ignored?", + Constraint (S)); + end if; + + if Nkind (P) = N_Subtype_Declaration then + Set_Subtype_Indication (P, + New_Occurrence_Of (Subtype_Mark_Id, Sloc (S))); + end if; + + return Subtype_Mark_Id; + end if; + Constrain_Access (Def_Id, S, Related_Nod); if Expander_Active |