File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -288,21 +288,28 @@ void ansi_c_convert_typet::write(typet &type)
288
288
error_msg ();
289
289
throw 0 ;
290
290
}
291
- else if (type.id ()!=ID_empty)
291
+
292
+ typet *type_p=&type;
293
+ if (type.id ()==ID_code)
294
+ type_p=&(to_code_type (type).return_type ());
295
+
296
+ else if (type_p->id ()!=ID_empty)
292
297
{
293
298
err_location (source_location);
294
- str << " constructor and destructor required to be type void" ;
299
+ str << " constructor and destructor required to be type void, "
300
+ << " found " << type_p->pretty ();
295
301
error_msg ();
296
302
throw 0 ;
297
303
}
298
304
299
- type. id (constructor ? ID_constructor : ID_destructor);
305
+ type_p-> id (constructor ? ID_constructor : ID_destructor);
300
306
}
301
307
}
302
308
else if (constructor || destructor)
303
309
{
304
310
err_location (source_location);
305
- str << " constructor and destructor required to be type void" ;
311
+ str << " constructor and destructor required to be type void, "
312
+ << " found " << type.pretty ();
306
313
error_msg ();
307
314
throw 0 ;
308
315
}
You can’t perform that action at this time.
0 commit comments