aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/vhdl/sem.adb2
-rw-r--r--testsuite/gna/issue542/nest.vhdl9
-rwxr-xr-xtestsuite/gna/issue542/testsuite.sh10
3 files changed, 21 insertions, 0 deletions
diff --git a/src/vhdl/sem.adb b/src/vhdl/sem.adb
index 6c2810d53..a19d66179 100644
--- a/src/vhdl/sem.adb
+++ b/src/vhdl/sem.adb
@@ -198,6 +198,8 @@ package body Sem is
-- considered to occur immediatly within the declarative region
-- associated with the entity declaration corresponding to the given
-- architecture body.
+ --
+ -- GHDL: this is only in vhdl-2002.
if Vhdl_Std = Vhdl_02 then
Open_Declarative_Region;
end if;
diff --git a/testsuite/gna/issue542/nest.vhdl b/testsuite/gna/issue542/nest.vhdl
new file mode 100644
index 000000000..0becf0fe2
--- /dev/null
+++ b/testsuite/gna/issue542/nest.vhdl
@@ -0,0 +1,9 @@
+entity nest is
+ constant c : natural := 1;
+end nest;
+
+architecture behav of nest is
+ -- Not valid in vhdl-02.
+ signal c : boolean;
+begin
+end behav;
diff --git a/testsuite/gna/issue542/testsuite.sh b/testsuite/gna/issue542/testsuite.sh
index b132693a1..300b24e3a 100755
--- a/testsuite/gna/issue542/testsuite.sh
+++ b/testsuite/gna/issue542/testsuite.sh
@@ -6,12 +6,22 @@ export GHDL_STD_FLAGS=--std=93
analyze write.vhd
analyze_failure wrapper.vhd
+analyze_failure nest.vhdl
+
+clean
+
+
+export GHDL_STD_FLAGS=--std=02
+analyze nest.vhdl
+
clean
export GHDL_STD_FLAGS=--std=08
analyze write.vhd
analyze_failure wrapper.vhd
+analyze_failure nest.vhdl
+
clean
echo "Test successful"