aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/vhdl-sem_specs.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-12-08 06:23:21 +0100
committerTristan Gingold <tgingold@free.fr>2020-12-08 19:32:22 +0100
commit07a7f419eea89b3ab901642291650f49dfb24a36 (patch)
tree9b822b1730535ebcc5b5e26492aa4d86e0b4ab1d /src/vhdl/vhdl-sem_specs.adb
parentebba3c77dc798f2e20ad6ba8a560a569faf1526b (diff)
downloadghdl-07a7f419eea89b3ab901642291650f49dfb24a36.tar.gz
ghdl-07a7f419eea89b3ab901642291650f49dfb24a36.tar.bz2
ghdl-07a7f419eea89b3ab901642291650f49dfb24a36.zip
vhdl: handle locally static attributes on entity/architecture/configurations
Attributes of entity/architecture/configurations are expected to be locally static so that they can be referenced from outside (so on the non-instantiated entity). But many designs break this assumption. In relaxed mode, non-locally static attributes are allowed but now cannot be referenced outside the entity. Locally static attributes can be referenced from outside. Fix #1528
Diffstat (limited to 'src/vhdl/vhdl-sem_specs.adb')
-rw-r--r--src/vhdl/vhdl-sem_specs.adb5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/vhdl/vhdl-sem_specs.adb b/src/vhdl/vhdl-sem_specs.adb
index 47db19ff7..5b1f54a67 100644
--- a/src/vhdl/vhdl-sem_specs.adb
+++ b/src/vhdl/vhdl-sem_specs.adb
@@ -836,8 +836,9 @@ package body Vhdl.Sem_Specs is
-- GHDL: test based on the entity_class.
case Get_Entity_Class (Spec) is
when Tok_Entity
- | Tok_Architecture
- | Tok_Configuration =>
+ | Tok_Architecture
+ | Tok_Configuration =>
+ Set_Static_Attribute_Flag (Spec, True);
if Get_Expr_Staticness (Expr) /= Locally then
Error_Msg_Sem_Relaxed
(Spec, Warnid_Attribute,