File tree 6 files changed +42
-4
lines changed
6 files changed +42
-4
lines changed Original file line number Diff line number Diff line change
1
+ #include < cassert>
2
+
3
+ class t1
4
+ {
5
+ public:
6
+ t1 (int n) : value(n)
7
+ {
8
+ }
9
+
10
+ int value;
11
+ int operator [](int n)
12
+ {
13
+ return n * value;
14
+ }
15
+ };
16
+
17
+ int operator +(t1 left, int right)
18
+ {
19
+ return left.value + right;
20
+ }
21
+
22
+ int main ()
23
+ {
24
+ t1 t (10 );
25
+ int t_1 = t + 5 ;
26
+ int t_2 = t[5 ];
27
+ assert (t_1 == 15 );
28
+ assert (t_2 == 50 );
29
+ return 0 ;
30
+ }
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 1
- KNOWNBUG
1
+ CORE
2
2
main.cpp
3
3
4
4
^EXIT=0$
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 @@ -3402,7 +3402,7 @@ bool Parser::rOperatorName(irept &name)
3402
3402
case ' <' :
3403
3403
case ' >' :
3404
3404
case ' ,' :
3405
- operator_id= irep_idt ( std::string (static_cast <char >(t), 1 ));
3405
+ operator_id = std::string (1 , static_cast <char >(t));
3406
3406
break ;
3407
3407
3408
3408
case TOK_MULTASSIGN: operator_id=" *=" ; break ;
You can’t perform that action at this time.
0 commit comments