[Ada] Disable special handling for preconditions specified by pragmas
authorEd Schonberg <schonberg@adacore.com>
Wed, 26 Sep 2018 09:16:39 +0000 (09:16 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Wed, 26 Sep 2018 09:16:39 +0000 (09:16 +0000)
2018-09-26  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* contracts.adb (Analyze_Entry_Or_Subprogram_Contract): The
analysis of preconditions specified by pragmas (rather than
aspects) is not delayed, and therefore expressions functions
that are completions do not need special handling during
expansion.

From-SVN: r264604

gcc/ada/ChangeLog
gcc/ada/contracts.adb

index cbedcc098da9d89cdf61284331dcaeae3ce8c1af..e1dd3eb9fb84203289a5fec8a42e49a13350d73f 100644 (file)
@@ -1,3 +1,11 @@
+2018-09-26  Ed Schonberg  <schonberg@adacore.com>
+
+       * contracts.adb (Analyze_Entry_Or_Subprogram_Contract): The
+       analysis of preconditions specified by pragmas (rather than
+       aspects) is not delayed, and therefore expressions functions
+       that are completions do not need special handling during
+       expansion.
+
 2018-09-26  Ed Schonberg  <schonberg@adacore.com>
 
        * exp_unst.adb: Fix handling of up level references for entries.
index 136c05c66d1f84116988878be2b9800d4304fd9d..8b18c398cc4ed2b34a7c0979e39ea411815c91ae 100644 (file)
@@ -620,7 +620,9 @@ package body Contracts is
 
                Prag := Pre_Post_Conditions (Items);
                while Present (Prag) loop
-                  if Freeze_Types then
+                  if Freeze_Types
+                    and then Present (Corresponding_Aspect (Prag))
+                  then
                      Freeze_Expr_Types
                        (Def_Id => Subp_Id,
                         Typ    => Standard_Boolean,