diff mbox series

[Ada] Fix oversight in Eval_Attribute for Bit_Position

Message ID 20201022121212.GA3971@adacore.com
State New
Headers show
Series [Ada] Fix oversight in Eval_Attribute for Bit_Position | expand

Commit Message

Pierre-Marie de Rodat Oct. 22, 2020, 12:12 p.m. UTC
The code would correctly distinguish the entity from the selected
component case but not use the result of the analysis in the latter
case.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

	* sem_attr.adb (Eval_Attribute): Fix oversight for Bit_Position.
diff mbox series

Patch

diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb
--- a/gcc/ada/sem_attr.adb
+++ b/gcc/ada/sem_attr.adb
@@ -7914,7 +7914,7 @@  package body Sem_Attr is
 
                if Known_Static_Component_Bit_Offset (CE) then
                   Compile_Time_Known_Attribute
-                    (N, Component_Bit_Offset (Entity (P)));
+                    (N, Component_Bit_Offset (CE));
                else
                   Check_Expressions;
                end if;