File tree 4 files changed +31
-2
lines changed
4 files changed +31
-2
lines changed Original file line number Diff line number Diff line change
1
+ #include < cassert>
2
+
3
+ class t1 {
4
+ public:
5
+ t1 (int n) :value(n) {}
6
+ public:
7
+ int value;
8
+ int operator [](int n) { return n*value; }
9
+ };
10
+
11
+ int operator +(t1 left, int right) {return left.value +right;}
12
+
13
+ int main ()
14
+ {
15
+ t1 t (10 );
16
+ int t_1 = t + 5 ;
17
+ int t_2 = t[5 ];
18
+ assert (t_1 == 15 );
19
+ assert (t_2 == 50 );
20
+ return 0 ;
21
+ }
Original file line number Diff line number Diff line change
1
+ CORE
2
+ main.cpp
3
+
4
+ ^EXIT=0$
5
+ ^SIGNAL=0$
6
+ --
7
+ ^warning: ignoring
8
+ ^CONVERSION ERROR$
Original file line number Diff line number Diff line change 1
- KNOWNBUG
1
+ CORE
2
2
main.cpp
3
3
4
4
^EXIT=0$
Original file line number Diff line number Diff line change @@ -3578,7 +3578,7 @@ bool Parser::rOperatorName(irept &name)
3578
3578
case ' <' :
3579
3579
case ' >' :
3580
3580
case ' ,' :
3581
- operator_id=irep_idt (std::string (static_cast <char >(t), 1 ));
3581
+ operator_id=irep_idt (std::string (1 , static_cast <char >(t)));
3582
3582
break ;
3583
3583
3584
3584
case TOK_MULTASSIGN: operator_id=" *=" ; break ;
You can’t perform that action at this time.
0 commit comments