File tree Expand file tree Collapse file tree 3 files changed +19
-2
lines changed
regression/cpp/Template_Instantiation4 Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 1
- KNOWNBUG
1
+ CORE
2
2
main.cpp
3
3
4
4
^EXIT=0$
Original file line number Diff line number Diff line change @@ -278,7 +278,12 @@ void cpp_typecheckt::clean_up()
278
278
const symbolt &symbol=cur_it->second ;
279
279
280
280
// erase templates
281
- if (symbol.type .get_bool (ID_is_template))
281
+ if (symbol.type .get_bool (ID_is_template) ||
282
+ // Remove all symbols that have not been converted.
283
+ // In particular this includes symbols created for functions
284
+ // during template instantiation that are never called,
285
+ // and hence, their bodies have not been converted.
286
+ contains_cpp_name (symbol.value ))
282
287
{
283
288
symbol_table.erase (cur_it);
284
289
continue ;
@@ -323,3 +328,13 @@ void cpp_typecheckt::clean_up()
323
328
}
324
329
}
325
330
}
331
+
332
+ bool cpp_typecheckt::contains_cpp_name (const exprt &expr)
333
+ {
334
+ if (expr.id ()==ID_cpp_name)
335
+ return true ;
336
+ forall_operands (it, expr)
337
+ if (contains_cpp_name (*it))
338
+ return true ;
339
+ return false ;
340
+ }
Original file line number Diff line number Diff line change @@ -587,6 +587,8 @@ class cpp_typecheckt:public c_typecheck_baset
587
587
exprt &new_expr,
588
588
bool check_constantness=true );
589
589
590
+ bool contains_cpp_name (const exprt &expr);
591
+
590
592
private:
591
593
typedef std::list<irep_idt> dynamic_initializationst;
592
594
dynamic_initializationst dynamic_initializations;
You can’t perform that action at this time.
0 commit comments