File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -387,9 +387,16 @@ static void gather_needed_globals(
387
387
{
388
388
if (e.id ()==ID_symbol)
389
389
{
390
- const auto &sym=symbol_table.lookup (to_symbol_expr (e).get_identifier ());
391
- if (sym.is_static_lifetime )
392
- needed.add (sym);
390
+ // If the symbol isn't in the symbol table at all, then it is defined
391
+ // on an opaque type (i.e. we don't have the class definition at this point)
392
+ // and will be created during the typecheck phase.
393
+ // We don't mark it as 'needed' as it doesn't exist yet to keep.
394
+ auto findit=symbol_table.symbols .find (to_symbol_expr (e).get_identifier ());
395
+ if (findit!=symbol_table.symbols .end () &&
396
+ findit->second .is_static_lifetime )
397
+ {
398
+ needed.add (findit->second );
399
+ }
393
400
}
394
401
else
395
402
forall_operands (opit, e)
You can’t perform that action at this time.
0 commit comments