Skip to content

Commit 5429624

Browse files
committed
Add Err in reserved keywords
1 parent 3ba03d4 commit 5429624

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

‎cpp2rust/converter/converter_lib.cpp‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ static const char rust_keywords[][12] = {
7373
"safe",
7474
// Standard library keywords
7575
"vec",
76+
"Err",
7677
};
7778

7879
namespace cpp2rust {

‎tests/unit/keywords.cpp‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
#include <cassert>
22

3+
int report(int Err) { return Err + 1; }
4+
35
int main() {
46
int in = 123;
57
assert(in == 123);
8+
int Err = 1;
9+
assert(report(Err) == 2);
610
return 0;
711
}

0 commit comments

Comments
 (0)