File tree Expand file tree Collapse file tree 4 files changed +20
-3
lines changed Expand file tree Collapse file tree 4 files changed +20
-3
lines changed Original file line number Diff line number Diff line change 1- KNOWNBUG
1+ CORE
22main.cpp
33-std=c++11
44^EXIT=0$
Original file line number Diff line number Diff line change 1- KNOWNBUG
1+ CORE
22main.cpp
33
44^EXIT=0$
Original file line number Diff line number Diff line change @@ -277,7 +277,12 @@ void cpp_typecheckt::clean_up()
277277 const symbolt &symbol=cur_it->second ;
278278
279279 // 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 ))
281286 {
282287 symbol_table.erase (cur_it);
283288 continue ;
@@ -327,3 +332,13 @@ bool cpp_typecheckt::builtin_factory(const irep_idt &identifier)
327332{
328333 return ::builtin_factory (identifier, symbol_table, get_message_handler ());
329334}
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
590590 exprt &new_expr,
591591 bool check_constantness=true );
592592
593+ bool contains_cpp_name (const exprt &expr);
594+
593595private:
594596 typedef std::list<irep_idt> dynamic_initializationst;
595597 dynamic_initializationst dynamic_initializations;
You can’t perform that action at this time.
0 commit comments