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