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 @@ -427,10 +427,6 @@ symbolt &cpp_declarator_convertert::convert_new_symbol(
427
427
symbol.is_macro =is_typedef && !is_template_parameter;
428
428
symbol.pretty_name =pretty_name;
429
429
430
- // Constant? These are propagated.
431
- if (symbol.type .get_bool (ID_C_constant) &&
432
- symbol.value .is_not_nil ())
433
- symbol.is_macro =true ;
434
430
435
431
if (member_spec.is_inline ())
436
432
symbol.type .set (ID_C_inlined, true );
Original file line number Diff line number Diff line change @@ -734,13 +734,6 @@ void cpp_typecheckt::typecheck_compound_declarator(
734
734
{
735
735
new_symbol->value .swap (value);
736
736
c_typecheck_baset::do_initializer (*new_symbol);
737
-
738
- // these are macros if they are PODs and come with a (constant) value
739
- if (new_symbol->type .get_bool (ID_C_constant))
740
- {
741
- simplify (new_symbol->value , *this );
742
- new_symbol->is_macro =true ;
743
- }
744
737
}
745
738
else
746
739
{
@@ -772,7 +765,18 @@ void cpp_typecheckt::check_fixed_size_array(typet &type)
772
765
array_typet &array_type=to_array_type (type);
773
766
774
767
if (array_type.size ().is_not_nil ())
768
+ {
769
+ if (array_type.size ().id () == ID_symbol)
770
+ {
771
+ const symbol_exprt &s = to_symbol_expr (array_type.size ());
772
+ const symbolt &symbol = lookup (s.get_identifier ());
773
+
774
+ if (cpp_is_pod (symbol.type ) && symbol.type .get_bool (ID_C_constant))
775
+ array_type.size () = symbol.value ;
776
+ }
777
+
775
778
make_constant_index (array_type.size ());
779
+ }
776
780
777
781
// recursive call for multi-dimensional arrays
778
782
check_fixed_size_array (array_type.subtype ());
Original file line number Diff line number Diff line change @@ -63,6 +63,8 @@ void cpp_typecheckt::typecheck_enum_body(symbolt &enum_symbol)
63
63
symbol.type =enum_tag_type;
64
64
symbol.is_type =false ;
65
65
symbol.is_macro =true ;
66
+ symbol.is_file_local = true ;
67
+ symbol.is_thread_local = true ;
66
68
67
69
symbolt *new_symbol;
68
70
if (symbol_table.move (symbol, new_symbol))
You can’t perform that action at this time.
0 commit comments