File tree Expand file tree Collapse file tree 3 files changed +13
-11
lines changed Expand file tree Collapse file tree 3 files changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -437,10 +437,6 @@ symbolt &cpp_declarator_convertert::convert_new_symbol(
437
437
symbol.is_macro =is_typedef && !is_template_parameter;
438
438
symbol.pretty_name =pretty_name;
439
439
440
- // Constant? These are propagated.
441
- if (symbol.type .get_bool (ID_C_constant) &&
442
- symbol.value .is_not_nil ())
443
- symbol.is_macro =true ;
444
440
445
441
if (member_spec.is_inline ())
446
442
symbol.type .set (ID_C_inlined, true );
Original file line number Diff line number Diff line change @@ -709,13 +709,6 @@ void cpp_typecheckt::typecheck_compound_declarator(
709
709
{
710
710
new_symbol->value .swap (value);
711
711
c_typecheck_baset::do_initializer (*new_symbol);
712
-
713
- // these are macros if they are PODs and come with a (constant) value
714
- if (new_symbol->type .get_bool (ID_C_constant))
715
- {
716
- simplify (new_symbol->value , *this );
717
- new_symbol->is_macro =true ;
718
- }
719
712
}
720
713
else
721
714
{
@@ -748,7 +741,18 @@ void cpp_typecheckt::check_fixed_size_array(typet &type)
748
741
array_typet &array_type=to_array_type (type);
749
742
750
743
if (array_type.size ().is_not_nil ())
744
+ {
745
+ if (array_type.size ().id () == ID_symbol)
746
+ {
747
+ const symbol_exprt &s = to_symbol_expr (array_type.size ());
748
+ const symbolt &symbol = lookup (s.get_identifier ());
749
+
750
+ if (cpp_is_pod (symbol.type ) && symbol.type .get_bool (ID_C_constant))
751
+ array_type.size () = symbol.value ;
752
+ }
753
+
751
754
make_constant_index (array_type.size ());
755
+ }
752
756
753
757
// recursive call for multi-dimensional arrays
754
758
check_fixed_size_array (array_type.subtype ());
Original file line number Diff line number Diff line change @@ -62,6 +62,8 @@ void cpp_typecheckt::typecheck_enum_body(symbolt &enum_symbol)
62
62
symbol.type =enum_tag_type;
63
63
symbol.is_type =false ;
64
64
symbol.is_macro =true ;
65
+ symbol.is_file_local = true ;
66
+ symbol.is_thread_local = true ;
65
67
66
68
symbolt *new_symbol;
67
69
if (symbol_table.move (symbol, new_symbol))
You can’t perform that action at this time.
0 commit comments