[Ada] Reuse a wrapper for Resolve with implicit type where possible
authorPiotr Trojanek <trojanek@adacore.com>
Tue, 1 Dec 2020 11:03:10 +0000 (12:03 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 3 May 2021 09:28:28 +0000 (05:28 -0400)
gcc/ada/

* sem_attr.adb (Analyze_Attribute): Reuse Resolve with implicit
type when analysing attribute Priority.
* sem_ch5.adb (Analyze_Case_Statement): Likewise for a rare case
in analysis of case statements.
(Analyze_Iterator_Specification): Likewise for non-overloaded
domain of iteration.

gcc/ada/sem_attr.adb
gcc/ada/sem_ch5.adb

index a4ecf6b..51bedb5 100644 (file)
@@ -5376,7 +5376,7 @@ package body Sem_Attr is
            or else (Is_Access_Type (Etype (P))
                       and then Is_Protected_Type (Designated_Type (Etype (P))))
          then
-            Resolve (P, Etype (P));
+            Resolve (P);
          else
             Error_Attr_P ("prefix of % attribute must be a protected object");
          end if;
index ccde8a5..f03467f 100644 (file)
@@ -1509,7 +1509,7 @@ package body Sem_Ch5 is
         and then Present (Full_View (Etype (Exp)))
         and then Is_Discrete_Type (Full_View (Etype (Exp)))
       then
-         Resolve (Exp, Etype (Exp));
+         Resolve (Exp);
          Exp_Type := Full_View (Etype (Exp));
 
       else
@@ -2360,7 +2360,7 @@ package body Sem_Ch5 is
          --  Domain of iteration is not overloaded
 
          else
-            Resolve (Iter_Name, Etype (Iter_Name));
+            Resolve (Iter_Name);
          end if;
 
          if not Of_Present (N) then