File tree 2 files changed +13
-2
lines changed
2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -1381,20 +1381,24 @@ data_declaration:
1381
1381
const_opt TOK_VAR lifetime_opt data_type_or_implicit list_of_variable_decl_assignments ' ;'
1382
1382
{ init ($$, ID_decl);
1383
1383
stack_expr ($$).set (ID_class, ID_var);
1384
- addswap ($$, ID_type, $4 );
1384
+ add_as_subtype (stack_type ($1 ), stack_type ($4 ));
1385
+ addswap ($$, ID_type, $1 );
1385
1386
swapop ($$, $5 ); }
1386
1387
| const_opt lifetime_opt data_type list_of_variable_decl_assignments ' ;'
1387
1388
{ init ($$, ID_decl);
1388
1389
stack_expr ($$).set (ID_class, ID_reg);
1389
- addswap ($$, ID_type, $3 );
1390
+ add_as_subtype (stack_type ($1 ), stack_type ($3 ));
1391
+ addswap ($$, ID_type, $1 );
1390
1392
swapop ($$, $4 ); }
1391
1393
| type_declaration
1392
1394
| package_import_declaration
1393
1395
;
1394
1396
1395
1397
const_opt:
1396
1398
/* Optional */
1399
+ { init ($$, ID_nil); }
1397
1400
| TOK_CONST
1401
+ { init ($$, ID_const); stack_type ($$).add_subtype ().make_nil (); }
1398
1402
;
1399
1403
1400
1404
package_import_declaration_brace:
Original file line number Diff line number Diff line change @@ -468,6 +468,13 @@ typet verilog_typecheck_exprt::elaborate_type(const typet &src)
468
468
tmp.subtype () = elaborate_type (tmp.subtype ());
469
469
return std::move (tmp);
470
470
}
471
+ else if (src.id () == ID_const)
472
+ {
473
+ auto tmp = to_type_with_subtype (src).subtype ();
474
+ elaborate_type (tmp);
475
+ tmp.set (ID_C_constant, true );
476
+ return tmp;
477
+ }
471
478
else
472
479
{
473
480
throw errort ().with_location (source_location)
You can’t perform that action at this time.
0 commit comments