]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Don't expect enumeration literals to be renamings
authorPiotr Trojanek <trojanek@adacore.com>
Wed, 20 Oct 2021 07:46:38 +0000 (09:46 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 25 Oct 2021 15:07:20 +0000 (15:07 +0000)
gcc/ada/

* lib-xref.adb (Get_Through_Renamings): Exit loop when an
enumeration literal is found.

gcc/ada/lib-xref.adb

index 17de8864befb8a441241447b708c7d421127621a..2c3c37233bb58a8bda2469e43f5a6c2a809595a7 100644 (file)
@@ -481,7 +481,9 @@ package body Lib.Xref is
                            --  e.g. function call, slicing of a function call,
                            --  pointer dereference, etc.
 
-                           if No (Obj) then
+                           if No (Obj)
+                             or else Ekind (Obj) = E_Enumeration_Literal
+                           then
                               return Empty;
                            end if;
                         else