aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_util.adb
diff options
context:
space:
mode:
authorEd Schonberg <schonberg@adacore.com>2016-04-18 09:52:22 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2016-04-18 11:52:22 +0200
commit88fa9a245cc307a62d119797dfcd9422425f2f45 (patch)
treee9c856e0730b169877d12cfd886fb7003f6dbad6 /gcc/ada/sem_util.adb
parent7b47778e62c578bea9b4e34dc4cf6f7f4d01e8bc (diff)
downloadgcc-88fa9a245cc307a62d119797dfcd9422425f2f45.zip
gcc-88fa9a245cc307a62d119797dfcd9422425f2f45.tar.gz
gcc-88fa9a245cc307a62d119797dfcd9422425f2f45.tar.bz2
sem_ch6.adb (Analyze_Expression_Function): Set Inlined flag on the entity of a subprogram declaration that is completed by...
2016-04-18 Ed Schonberg <schonberg@adacore.com> * sem_ch6.adb (Analyze_Expression_Function): Set Inlined flag on the entity of a subprogram declaration that is completed by an expression function. 2016-04-18 Ed Schonberg <schonberg@adacore.com> * sem_util.adb (Is_Current_Instance): A entity given by a subtype declaration can appear in an aspect specification for a dynamic predicate, and a pragma for aspect Predicate_Failure. * exp_util.adb (Replace_Subtype_References): Replace current occurrences of the subtype to which a dynamic predicate applies, byt the expression that triggers a predicate check. Needed to implement new aspect Predicate_Failure. From-SVN: r235107
Diffstat (limited to 'gcc/ada/sem_util.adb')
-rw-r--r--gcc/ada/sem_util.adb17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index f100a07..7bfe724 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -11574,6 +11574,23 @@ package body Sem_Util is
and then Defining_Entity (P) = Typ
then
return True;
+
+ -- A subtype name may appear in an aspect specification for a
+ -- Predicate_Failure aspect, for which we do not construct a
+ -- wrapper procedure. The subtype will be replaced by the
+ -- expression being tested when the corresponding predicate
+ -- check is expanded.
+
+ elsif Nkind (P) = N_Aspect_Specification
+ and then Nkind (Parent (P)) = N_Subtype_Declaration
+ then
+ return True;
+
+ elsif Nkind (P) = N_Pragma
+ and then
+ Get_Pragma_Id (Pragma_Name (P)) = Pragma_Predicate_Failure
+ then
+ return True;
end if;
P := Parent (P);