Skip to content

Commit da7822b

Browse files
committed
Mark already-typechecked types as such
1 parent 6c6618b commit da7822b

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

src/cpp/cpp_typecheck_code.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,9 @@ void cpp_typecheckt::typecheck_decl(codet &code)
384384
return;
385385
}
386386

387+
// mark as 'already typechecked'
388+
make_already_typechecked(type);
389+
387390
codet new_code(ID_decl_block);
388391
new_code.reserve_operands(declaration.declarators().size());
389392

src/cpp/cpp_typecheck_declaration.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ void cpp_typecheckt::convert_non_template_declaration(
124124
if(!is_typedef)
125125
elaborate_class_template(declaration_type);
126126

127+
// mark as 'already typechecked'
128+
if(!declaration.declarators().empty())
129+
make_already_typechecked(declaration_type);
130+
127131
// Special treatment for anonymous unions
128132
if(declaration.declarators().empty() &&
129133
follow(declaration.type()).get_bool(ID_C_is_anonymous))

src/cpp/cpp_typecheck_type.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,10 @@ void cpp_typecheckt::typecheck_type(typet &type)
249249
else if(type.id()==ID_nullptr)
250250
{
251251
}
252+
else if(type.id()==ID_already_typechecked)
253+
{
254+
c_typecheck_baset::typecheck_type(type);
255+
}
252256
else
253257
{
254258
error().source_location=type.source_location();

src/cpp/cpp_util.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ exprt cpp_symbol_expr(const symbolt &symbol);
1717

1818
inline void already_typechecked(irept &irep)
1919
{
20-
exprt tmp("already_typechecked");
20+
exprt tmp(ID_already_typechecked);
2121
tmp.copy_to_operands(static_cast<exprt &>(irep));
2222
irep.swap(tmp);
2323
}

0 commit comments

Comments
 (0)