From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4f1d7f0bd7ae1b5c,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-05-06 16:24:24 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news-out.visi.com!hermes.visi.com!newsfeed1.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread2.prod.itd.earthlink.net.POSTED!not-for-mail Message-ID: <3CD710A0.4743@earthlink.net> From: Vincent Marciante X-Mailer: Mozilla 3.0 (OS/2; I) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Static expression question Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Mon, 06 May 2002 23:24:23 GMT NNTP-Posting-Host: 63.185.163.218 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.prod.itd.earthlink.net 1020727463 63.185.163.218 (Mon, 06 May 2002 16:24:23 PDT) NNTP-Posting-Date: Mon, 06 May 2002 16:24:23 PDT Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: archiver1.google.com comp.lang.ada:23603 Date: 2002-05-06T23:24:23+00:00 List-Id: Isn't the renaming of an enumeration literal as a function supposed to be considered to be a static expression? GNAT 3.14p and ObjectAda 7.2 give different results regarding the following code procedure test_static_rename is type enum is (first_enum, last_enum); --[1] function renamed_last_enum return enum renames last_enum; --[2] enum_value : enum := last_enum; begin case enum_value is when first_enum => null; when renamed_last_enum => --[3] legal? null; end case; end; I think that renamed_last_enum at [3] is supposed to be considered to be a static expression due to the following: At [3] there is a function call to renamed_last_enum and ARM 4.9(2) A static expression is a scalar or string expression that is one of the following: <...> ARM 4.9(6) a function_call whose function_name or function_prefix statically denotes a static function, and <...> At [2] renamed_last_enum statically denotes enum_last as per ARM 4.9(14) A name _statically_denotes_ an entity if it denotes an entity and: <...> ARM 4.9(17) It denotes a renaming_declaration with a name that statically denotes the renamed entity. At [1] enum_last is a static function as per ARM 4.9(18) A static function is one of the following: <...> ARM 4.9(21) an enumeration literal; If my conclusion from the above is incorrect then I would like to know the correct ARM passages that apply. Thanks in advance. Vincent Marciante (To reply directly, please r e m o v e "_ r e m o v e" from my email address. Sorry for the inconvenience.)