]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Bad handling of ASCII with -gnatyn
authorArnaud Charlet <charlet@adacore.com>
Thu, 19 Jan 2023 13:34:20 +0000 (13:34 +0000)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 16 May 2023 08:30:56 +0000 (10:30 +0200)
ASCII is special cased but this wasn't taking into account all cases
such as Standard.ASCII.

gcc/ada/

* snames.ads-tmpl (Name_ASCII): New.
* style.adb (Check_Identifier): Fix handling of ASCII.

gcc/ada/snames.ads-tmpl
gcc/ada/style.adb

index 8f71ad98db3e22aab84fe9f99f866e12efdc966a..afe7508ac28205f37081713a8ec54d632f2e72ed 100644 (file)
@@ -260,6 +260,7 @@ package Snames is
 
    --  Some miscellaneous names used for error detection/recovery
 
+   Name_ASCII                          : constant Name_Id := N + $;
    Name_Const                          : constant Name_Id := N + $;
    Name_Error                          : constant Name_Id := N + $;
    Name_False                          : constant Name_Id := N + $;
index 3014359acba102f5d9b68b87d9a98530b899b445..dda5cd47c061e5198026c94cad22aba3f1ac4bfb 100644 (file)
@@ -35,9 +35,8 @@ with Nlists;         use Nlists;
 with Opt;            use Opt;
 with Sinfo;          use Sinfo;
 with Sinfo.Nodes;    use Sinfo.Nodes;
-with Sinfo.Utils;    use Sinfo.Utils;
 with Sinput;         use Sinput;
-with Stand;          use Stand;
+with Snames;         use Snames;
 with Stylesw;        use Stylesw;
 
 package body Style is
@@ -201,7 +200,7 @@ package body Style is
             else
                --  ASCII is all upper case
 
-               if Entity (Ref) = Standard_ASCII then
+               if Chars (Ref) = Name_ASCII then
                   Cas := All_Upper_Case;
 
                --  Special handling for names in package ASCII