diff --git a/src/sem.c b/src/sem.c index e67f613c2..797bcf43a 100644 --- a/src/sem.c +++ b/src/sem.c @@ -4909,10 +4909,7 @@ static bool sem_check_generic_actual(formal_map_t *formals, int nformals, "generic %s", type_pp(tree_type(value)), type_pp(type), istr(tree_ident(decl))); - if (!sem_globally_static(value)) - sem_error(value, "actual associated with generic %s must be " - "a globally static expression", istr(tree_ident(decl))); - + sem_check_static_elab(value); break; default: diff --git a/test/sem/gensub.vhd b/test/sem/gensub.vhd index 782cb38e9..0c2ba9af3 100644 --- a/test/sem/gensub.vhd +++ b/test/sem/gensub.vhd @@ -57,7 +57,7 @@ begin return y + t; -- Error end function; - function inner_inst is new inner generic map (q => t, y => x); -- Error + function inner_inst is new inner generic map (q => t, y => x); -- OK (???) begin return inner_inst; end function; diff --git a/test/test_sem.c b/test/test_sem.c index 5c50370bf..7da155f26 100644 --- a/test/test_sem.c +++ b/test/test_sem.c @@ -518,7 +518,7 @@ START_TEST(test_generics) { 48, "no visible declaration for X" }, { 58, "invalid object class signal for generic Y" }, { 68, "no visible declaration for Y" }, - { 110, "with generic X must be a globally static expression" }, + { 110, "cannot reference signal SX during static elaboration" }, { 116, "unexpected integer while parsing name" }, { 115, "missing actual for generic X without a default expression" }, { 119, "invalid name in generic map" }, @@ -2820,7 +2820,6 @@ START_TEST(test_gensub) { 44, "cannot call uninstantiated function ADDER" }, { 50, "cannot call uninstantiated procedure DO_STUFF" }, { 57, "no matching operator \"+\" [Q, T return Q]" }, - { 60, "actual associated with generic Y must be a globally static" }, { 69, "subtype of generic X does not match type INTEGER in spec" }, { 75, "subprogram TEST2 declaration has 1 generic but body has 2" }, { 93, "multiple visible uninstantiated subprograms with name TEST1" },