diff --git a/src/ansi-c/c_typecheck_type.cpp b/src/ansi-c/c_typecheck_type.cpp index d82e81c0038..ac3fe7f2928 100644 --- a/src/ansi-c/c_typecheck_type.cpp +++ b/src/ansi-c/c_typecheck_type.cpp @@ -54,7 +54,7 @@ void c_typecheck_baset::typecheck_type(typet &type) exprt alignment=static_cast(type.find(ID_C_alignment)); irept _typedef=type.find(ID_C_typedef); - type.swap(type.subtype()); + type=type.subtype(); c_qualifiers.write(type); if(packed) diff --git a/src/ansi-c/padding.cpp b/src/ansi-c/padding.cpp index cdcc1cd802b..16391ee33a7 100644 --- a/src/ansi-c/padding.cpp +++ b/src/ansi-c/padding.cpp @@ -203,7 +203,7 @@ void add_padding(struct_typet &type, const namespacet &ns) it!=components.end(); it++) { - const typet &it_type=it->type(); + const typet it_type=it->type(); mp_integer a=1; const bool packed=it_type.get_bool(ID_C_packed) ||