From 4660e0bf2f000ba8b67ea0001120c555a2409ed2 Mon Sep 17 00:00:00 2001 From: Cary R Date: Sun, 2 Nov 2014 20:25:35 -0800 Subject: [PATCH] Another tweak to the enumeration elaboration code --- elab_scope.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/elab_scope.cc b/elab_scope.cc index 236031907..a2f4c8e6b 100644 --- a/elab_scope.cc +++ b/elab_scope.cc @@ -253,8 +253,10 @@ static void elaborate_scope_enumeration(Design*des, NetScope*scope, } // If we are padding/truncating a negative value for an - // unsigned enumeration that is an error. - if ((cur_value.len() != enum_width) && + // unsigned enumeration that is an error or if the new + // value does not have a defined width. + if (((cur_value.len() != enum_width) || + ! cur_value.has_len()) && ! enum_type->signed_flag && cur_value.is_negative()) { cerr << use_enum->get_fileline() << ": error: Enumeration name " << cur->name