aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch5.adb
diff options
context:
space:
mode:
authorEd Schonberg <schonberg@adacore.com>2014-08-01 08:22:22 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2014-08-01 10:22:22 +0200
commita62828520413d90d5dd11c43068b31a46d4fbd75 (patch)
treeefca47fc8a07665edf55f42f6a080abec3a50aff /gcc/ada/sem_ch5.adb
parentfd29c0247aa4af7492782e6c933c713c6732b4b0 (diff)
downloadgcc-a62828520413d90d5dd11c43068b31a46d4fbd75.zip
gcc-a62828520413d90d5dd11c43068b31a46d4fbd75.tar.gz
gcc-a62828520413d90d5dd11c43068b31a46d4fbd75.tar.bz2
2014-08-01 Ed Schonberg <schonberg@adacore.com>
* einfo.ads, einfo.adb New flags No_Predicate_On_Actual and No_Dynamic_Predicate_On_Actual, to enforce the generic contract on generic units that contain constructs that forbid subtypes with predicates. * sem_ch3.adb (Analyze_Subtype_Declaration, Process_Subtype): Inherit flags indicating the presence of predicates in subtype declarations with and without constraints. (Inherit_Predicate_Flags): Utility for the above. * sem_util.adb (Bad_Predicated_Subtype_Use): In a generic context, indicate that the actual cannot have predicates, and preserve warning. In an instance, report error if actual has predicates and the construct appears in a package declaration. * sem_ch12.adb (Diagnose_Predicated_Actual): Report error for an actual with predicates, if the corresponding formal carries No_Predicate_On_Actual or (in the case of a loop) No_Dynamic_Predicate_On_Actual. * sem_ch13.adb (Build_Predicate_Functions); Do not build a Static_Predicate function if the type is non-static (in the presence of previous errors), * sem_ch5.adb (Analyze_Loop_Parameter_Specification): Set flag No_Dynamic_Predicate_On_Actual in a generic context, to enforce generic contract on actuals that cannot have predicates. From-SVN: r213418
Diffstat (limited to 'gcc/ada/sem_ch5.adb')
-rw-r--r--gcc/ada/sem_ch5.adb3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb
index 9106aa2..56db2bc 100644
--- a/gcc/ada/sem_ch5.adb
+++ b/gcc/ada/sem_ch5.adb
@@ -2509,6 +2509,9 @@ package body Sem_Ch5 is
Bad_Predicated_Subtype_Use
("cannot use subtype& with non-static predicate for loop " &
"iteration", DS, Entity (DS), Suggest_Static => True);
+
+ elsif Inside_A_Generic and then Is_Generic_Formal (Entity (DS)) then
+ Set_No_Dynamic_Predicate_On_Actual (Entity (DS));
end if;
end if;