]> gcc.gnu.org Git - gcc.git/commitdiff
[multiple changes]
authorPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Thu, 9 Nov 2017 12:52:41 +0000 (12:52 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Thu, 9 Nov 2017 12:52:41 +0000 (12:52 +0000)
2017-11-09  Ed Schonberg  <schonberg@adacore.com>

* sem_ch12.adb (Analyze_Subprogram_Instantiation): Correct use of
uninitialized variable uncovered by Codepeer.

2017-11-09  Arnaud Charlet  <charlet@adacore.com>

* namet.adb: Replace pragma Assume by pragma Assert to fix bootstrap.

2017-11-09  Javier Miranda  <miranda@adacore.com>

* doc/gnat_rm/standard_and_implementation_defined_restrictions.rst:
(Static_Dispatch_Tables): Minor rewording.
* gnat_rm.texi: Regenerate.

2017-11-09  Justin Squirek  <squirek@adacore.com>

* sem_ch8.adb (Analyze_Use_Package): Remove forced installation of
use_clauses within instances.
(Use_One_Package): Add condition to check for "hidden" open scopes to
avoid skipping over packages that have not been properly installed even
though they are visible.

2017-11-09  Ed Schonberg  <schonberg@adacore.com>

* sem_ch4.adb (Analyze_Selected_Component): Reject properly a call to a
private operation of a protected type, when the type has no visible
operations.

From-SVN: r254578

gcc/ada/ChangeLog
gcc/ada/doc/gnat_rm/standard_and_implementation_defined_restrictions.rst
gcc/ada/gnat_rm.texi
gcc/ada/namet.adb
gcc/ada/sem_ch12.adb
gcc/ada/sem_ch4.adb
gcc/ada/sem_ch8.adb

index d2a48f73c0a9033262687ad11cdf7e13140529d5..72d5844397fe4a275465abe765293b0b5fbac98d 100644 (file)
@@ -1,3 +1,32 @@
+2017-11-09  Ed Schonberg  <schonberg@adacore.com>
+
+       * sem_ch12.adb (Analyze_Subprogram_Instantiation): Correct use of
+       uninitialized variable uncovered by Codepeer.
+
+2017-11-09  Arnaud Charlet  <charlet@adacore.com>
+
+       * namet.adb: Replace pragma Assume by pragma Assert to fix bootstrap.
+
+2017-11-09  Javier Miranda  <miranda@adacore.com>
+
+       * doc/gnat_rm/standard_and_implementation_defined_restrictions.rst:
+       (Static_Dispatch_Tables): Minor rewording.
+       * gnat_rm.texi: Regenerate.
+
+2017-11-09  Justin Squirek  <squirek@adacore.com>
+
+       * sem_ch8.adb (Analyze_Use_Package): Remove forced installation of
+       use_clauses within instances.
+       (Use_One_Package): Add condition to check for "hidden" open scopes to
+       avoid skipping over packages that have not been properly installed even
+       though they are visible.
+
+2017-11-09  Ed Schonberg  <schonberg@adacore.com>
+
+       * sem_ch4.adb (Analyze_Selected_Component): Reject properly a call to a
+       private operation of a protected type, when the type has no visible
+       operations.
+
 2017-11-09  Javier Miranda  <miranda@adacore.com>
 
        * rtsfind.ads (RE_Id, RE_Unit_Table): Add RE_HT_Link.
index 2174636e4c567cf2916a61c360f88b909e5ea383..1f56403f81afdf994d0ac514228646e5a50a8cae 100644 (file)
@@ -992,7 +992,7 @@ Static_Dispatch_Tables
 ----------------------
 .. index:: Static_Dispatch_Tables
 
-[GNAT] This restriction ensures at compile time that all the artifacts
+[GNAT] This restriction checks at compile time that all the artifacts
 associated with dispatch tables can be placed in read-only memory.
 
 SPARK_05
index 21c195d21c1d39056c4d83320ad02a7dc96d437e..0a2b151dffa8ee7281484000d852d21c6ce69f69 100644 (file)
@@ -13141,7 +13141,7 @@ type @code{Character}).
 
 @geindex Static_Dispatch_Tables
 
-[GNAT] This restriction ensures at compile time that all the artifacts
+[GNAT] This restriction checks at compile time that all the artifacts
 associated with dispatch tables can be placed in read-only memory.
 
 @node SPARK_05,,Static_Dispatch_Tables,Program Unit Level Restrictions
index 153c79b33c5598b34e7a2de9870a207d08918be4..04e92dab55cea6d220b277e5b0feaddad0851d47 100644 (file)
@@ -261,8 +261,10 @@ package body Namet is
                   declare
                      W2 : constant Word := Hex (2);
                   begin
-                     pragma Assume (W2 <= 255);
-                     --  Add assumption to facilitate static analysis
+                     pragma Assert (W2 <= 255);
+                     --  Add assumption to facilitate static analysis. Note
+                     --  that we cannot use pragma Assume for bootstrap
+                     --  reasons.
                      Insert_Character (Character'Val (W2));
                   end;
                end if;
@@ -759,7 +761,7 @@ package body Namet is
 
       Write_Eol;
       Write_Str ("Average number of probes for lookup = ");
-      pragma Assume (Nsyms /= 0);
+      pragma Assert (Nsyms /= 0);
       --  Add assumption to facilitate static analysis. Here Nsyms cannot be
       --  zero because many symbols are added to the table by default.
       Probes := Probes / Nsyms;
index 6cdc9f3e21b912209b7a0d0c11f0af7cd96cfd66..7aca1d9236f7c440c73a28a778a518dd5d5d3ad6 100644 (file)
@@ -5130,6 +5130,7 @@ package body Sem_Ch12 is
    is
       Loc    : constant Source_Ptr := Sloc (N);
       Gen_Id : constant Node_Id    := Name (N);
+      Errs   : constant Nat        := Serious_Errors_Detected;
 
       Anon_Id : constant Entity_Id :=
                   Make_Defining_Identifier (Sloc (Defining_Entity (N)),
@@ -5723,7 +5724,9 @@ package body Sem_Ch12 is
       end if;
 
    <<Leave>>
-      if Has_Aspects (N) then
+      --  Analyze aspects in declaration if no errors appear in the instance.
+
+      if Has_Aspects (N) and then Serious_Errors_Detected = Errs then
          Analyze_Aspect_Specifications (N, Act_Decl_Id);
       end if;
 
index f2d1acfdc08ce7b9038113ed15ffac084ac366a1..d13140fb135b1305e5cb2e08b77dcc4bac2516e8 100644 (file)
@@ -5043,10 +5043,13 @@ package body Sem_Ch4 is
                   end if;
                end if;
 
-               Next_Entity (Comp);
+               --  Do not examine private operations if not within scope of
+               --  the synchronized type.
+
                exit when not In_Scope
                  and then
                    Comp = First_Private_Entity (Base_Type (Prefix_Type));
+               Next_Entity (Comp);
          end loop;
 
          --  If the scope is a current instance, the prefix cannot be an
index aea9bf8b48061c537a41b2ed440ed4b2a76b3c3f..d8d5b7b5c04f651db5217b3c71a90e4f1777473a 100644 (file)
@@ -3821,10 +3821,7 @@ package body Sem_Ch8 is
             Check_In_Previous_With_Clause (N, Name (N));
          end if;
 
-         --  Force the use_clause when we are in a generic instance because the
-         --  scope of the package has changed and we must ensure visibility.
-
-         Use_One_Package (N, Name (N), Force => In_Instance);
+         Use_One_Package (N, Name (N));
 
          --  Capture the first Ghost package and the first living package
 
@@ -9443,7 +9440,10 @@ package body Sem_Ch8 is
 
          --  Warn about detected redundant clauses
 
-         elsif In_Open_Scopes (P) and not Force then
+         elsif not Force
+           and then In_Open_Scopes (P)
+           and then not Is_Hidden_Open_Scope (P)
+         then
             if Warn_On_Redundant_Constructs and then P = Current_Scope then
                Error_Msg_NE -- CODEFIX
                  ("& is already use-visible within itself?r?",
This page took 0.103149 seconds and 5 git commands to generate.