]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Fix minor discrepancy in Expand_N_Attribute_Reference
authorEric Botcazou <ebotcazou@adacore.com>
Tue, 17 Dec 2019 12:10:11 +0000 (13:10 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Tue, 2 Jun 2020 08:58:14 +0000 (04:58 -0400)
2020-06-02  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* exp_attr.adb (Expand_N_Attribute_Reference)
<Attribute_Alignment>: Adjust comment and compare against proper
type.

gcc/ada/exp_attr.adb

index d658f0b3c987db75ecaa1c7b99bd7ee93a25d0eb..731d223122c73da10b31be9efd475bd5ea96dbb9 100644 (file)
@@ -2460,11 +2460,11 @@ package body Exp_Attr is
             New_Node := Build_Get_Alignment (Loc, New_Node);
 
             --  Case where the context is a specific integer type with which
-            --  the original attribute was compatible. The function has a
-            --  specific type as well, so to preserve the compatibility we
-            --  must convert explicitly.
+            --  the original attribute was compatible. But the alignment has a
+            --  specific type in a-tags.ads (Standard.Natural) so, in order to
+            --  preserve type compatibility, we must convert explicitly.
 
-            if Typ /= Standard_Integer then
+            if Typ /= Standard_Natural then
                New_Node := Convert_To (Typ, New_Node);
             end if;