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
22main.cpp
33
44^EXIT=0$
Original file line number Diff line number Diff line change @@ -278,7 +278,12 @@ void cpp_typecheckt::clean_up()
278278 const symbolt &symbol=cur_it->second ;
279279
280280 // 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 ))
282287 {
283288 symbol_table.erase (cur_it);
284289 continue ;
@@ -323,3 +328,13 @@ void cpp_typecheckt::clean_up()
323328 }
324329 }
325330}
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
587587 exprt &new_expr,
588588 bool check_constantness=true );
589589
590+ bool contains_cpp_name (const exprt &expr);
591+
590592private:
591593 typedef std::list<irep_idt> dynamic_initializationst;
592594 dynamic_initializationst dynamic_initializations;
You can’t perform that action at this time.
0 commit comments