diff options
author | Tristan Gingold <tgingold@free.fr> | 2014-01-01 07:18:58 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2014-01-01 07:18:58 +0100 |
commit | 237fd4c864c50a8b0ab99daf198ad60790cb6d0f (patch) | |
tree | 315bb7ed4bde66b1f0dea79a5fce454b0adce2f1 /sem_specs.adb | |
parent | 8f92f5f35a740182637d137b934b539a7a469014 (diff) | |
download | ghdl-237fd4c864c50a8b0ab99daf198ad60790cb6d0f.tar.gz ghdl-237fd4c864c50a8b0ab99daf198ad60790cb6d0f.tar.bz2 ghdl-237fd4c864c50a8b0ab99daf198ad60790cb6d0f.zip |
Fix bug18280, and add it.
Diffstat (limited to 'sem_specs.adb')
-rw-r--r-- | sem_specs.adb | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/sem_specs.adb b/sem_specs.adb index 885a41abc..11a3711bd 100644 --- a/sem_specs.adb +++ b/sem_specs.adb @@ -331,7 +331,9 @@ package body Sem_Specs is is Res : Boolean; - procedure Sem_Named_Entity1 (Ent : Iir; Decl : Iir) + -- If declaration DECL matches then named entity ENT, apply attribute + -- specification and returns TRUE. Otherwise, return FALSE. + function Sem_Named_Entity1 (Ent : Iir; Decl : Iir) return Boolean is Ent_Id : Name_Id; begin @@ -345,9 +347,10 @@ package body Sem_Specs is else Attribute_A_Decl (Decl, Attr, Name, Is_Designators, Check_Defined); - Res := True; + return True; end if; end if; + return False; end Sem_Named_Entity1; procedure Sem_Named_Entity (Ent : Iir) is @@ -366,7 +369,7 @@ package body Sem_Specs is | Iir_Kind_Unit_Declaration | Iir_Kind_Group_Template_Declaration | Iir_Kind_Group_Declaration => - Sem_Named_Entity1 (Ent, Ent); + Res := Res or Sem_Named_Entity1 (Ent, Ent); when Iir_Kind_Object_Alias_Declaration => -- LRM93 5.1 -- An entity designator that denotes an alias of an object is @@ -374,18 +377,19 @@ package body Sem_Specs is -- or slice thereof. declare Decl : Iir; + Applied : Boolean; begin Decl := Get_Name (Ent); - if Get_Base_Name (Decl) /= Decl then + Applied := Sem_Named_Entity1 (Ent, Decl); + if Applied and then Get_Base_Name (Decl) /= Decl then Error_Msg_Sem (Disp_Node (Ent) & " does not denote the entire object", Attr); - return; end if; - Sem_Named_Entity1 (Ent, Decl); + Res := Res or Applied; end; when Iir_Kind_Non_Object_Alias_Declaration => - Sem_Named_Entity1 (Ent, Get_Name (Ent)); + Res := Res or Sem_Named_Entity1 (Ent, Get_Name (Ent)); when Iir_Kind_Attribute_Declaration | Iir_Kind_Attribute_Specification | Iir_Kind_Configuration_Specification |