File tree 3 files changed +9
-3
lines changed
3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -104,10 +104,15 @@ symbolt &cpp_declarator_convertert::convert(
104
104
{
105
105
// adjust type if it's a non-static member function
106
106
if (final_type.id ()==ID_code)
107
+ {
108
+ cpp_save_scopet save_scope (cpp_typecheck.cpp_scopes );
109
+ cpp_typecheck.cpp_scopes .go_to (*scope);
110
+
107
111
cpp_typecheck.add_this_to_method_type (
108
112
cpp_typecheck.lookup (scope->identifier ),
109
113
to_code_type (final_type),
110
114
method_qualifier);
115
+ }
111
116
112
117
get_final_identifier ();
113
118
Original file line number Diff line number Diff line change @@ -1360,9 +1360,10 @@ void cpp_typecheckt::add_this_to_method_type(
1360
1360
subtype.set (ID_C_volatile, true );
1361
1361
1362
1362
code_typet::parametert parameter (pointer_type (subtype));
1363
- parameter.set_identifier (ID_this); // check? Not qualified
1363
+ parameter.set_identifier (ID_this);
1364
1364
parameter.set_base_name (ID_this);
1365
1365
parameter.set_this ();
1366
+ convert_parameter (compound_symbol.mode , parameter);
1366
1367
1367
1368
code_typet::parameterst ¶meters = type.parameters ();
1368
1369
parameters.insert (parameters.begin (), parameter);
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ void cpp_typecheckt::convert_parameter(
31
31
parameter.set_base_name (base_name);
32
32
}
33
33
34
+ PRECONDITION (!cpp_scopes.current_scope ().prefix .empty ());
34
35
irep_idt identifier=cpp_scopes.current_scope ().prefix +
35
36
id2string (base_name);
36
37
@@ -171,8 +172,7 @@ irep_idt cpp_typecheckt::function_identifier(const typet &type)
171
172
code_typet::parameterst::const_iterator it=
172
173
parameters.begin ();
173
174
174
- if (it!=parameters.end () &&
175
- it->get_identifier ()==ID_this)
175
+ if (it != parameters.end () && it->get_base_name () == ID_this)
176
176
{
177
177
const typet &pointer=it->type ();
178
178
const typet &symbol =pointer.subtype ();
You can’t perform that action at this time.
0 commit comments