File tree 3 files changed +96
-95
lines changed
3 files changed +96
-95
lines changed Original file line number Diff line number Diff line change @@ -319,6 +319,28 @@ class exprt:public irept
319
319
const_unique_depth_iteratort unique_depth_cend () const ;
320
320
};
321
321
322
+ // / Base class for all expressions. This protects low-level methods in
323
+ // / exprt that are not type safe. Depcrecated constructors are removed.
324
+ // / This API will eventually replace exprt.
325
+ class expr_protectedt : public exprt
326
+ {
327
+ protected:
328
+ // constructors
329
+ expr_protectedt (const irep_idt &_id, const typet &_type) : exprt(_id, _type)
330
+ {
331
+ }
332
+
333
+ // protect these low-level methods
334
+ using exprt::add;
335
+ using exprt::make_bool;
336
+ using exprt::make_typecast;
337
+ using exprt::op0;
338
+ using exprt::op1;
339
+ using exprt::op2;
340
+ using exprt::op3;
341
+ using exprt::remove;
342
+ };
343
+
322
344
class expr_visitort
323
345
{
324
346
public:
Original file line number Diff line number Diff line change @@ -167,8 +167,8 @@ extractbits_exprt::extractbits_exprt(
167
167
const exprt &_src,
168
168
const std::size_t _upper,
169
169
const std::size_t _lower,
170
- const typet &_type):
171
- exprt (ID_extractbits, _type)
170
+ const typet &_type)
171
+ : expr_protectedt (ID_extractbits, _type)
172
172
{
173
173
PRECONDITION (_upper >= _lower);
174
174
operands ().resize (3 );
You can’t perform that action at this time.
0 commit comments