File tree Expand file tree Collapse file tree 4 files changed +31
-2
lines changed Expand file tree Collapse file tree 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
22main.cpp
33
44^EXIT=0$
Original file line number Diff line number Diff line change @@ -3578,7 +3578,7 @@ bool Parser::rOperatorName(irept &name)
35783578 case ' <' :
35793579 case ' >' :
35803580 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)));
35823582 break ;
35833583
35843584 case TOK_MULTASSIGN: operator_id=" *=" ; break ;
You can’t perform that action at this time.
0 commit comments