diff options
Diffstat (limited to 'src/vhdl/sem_decls.adb')
-rw-r--r-- | src/vhdl/sem_decls.adb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/vhdl/sem_decls.adb b/src/vhdl/sem_decls.adb index da7b1b2be..1332ff979 100644 --- a/src/vhdl/sem_decls.adb +++ b/src/vhdl/sem_decls.adb @@ -1495,9 +1495,9 @@ package body Sem_Decls is end if; end Sem_Subtype_Declaration; - -- If DECL is a constant declaration, and there is already a constant - -- declaration in the current scope with the same name, then return it. - -- Otherwise, return NULL. + -- If DECL is a constant declaration, and there is already a incomplete + -- constant declaration in the current scope with the same name, then + -- return it. Otherwise, return NULL. function Get_Deferred_Constant (Decl : Iir) return Iir is Deferred_Const : Iir; @@ -1523,6 +1523,10 @@ package body Sem_Decls is if Get_Kind (Deferred_Const) /= Iir_Kind_Constant_Declaration then return Null_Iir; end if; + if not Get_Deferred_Declaration_Flag (Deferred_Const) then + -- Just a 'normal' duplicate declaration + return Null_Iir; + end if; -- LRM93 4.3.1.1 -- The corresponding full constant declaration, which defines the value -- of the constant, must appear in the body of the package. |