PR rust/29859 points out an operator precedence bug in the Rust
parser. This patch fixes it and adds a regression test.
break;
}
- while (precedence < operator_stack.back ().precedence
+ while (precedence <= operator_stack.back ().precedence
&& operator_stack.size () > 1)
{
rustop_item rhs = std::move (operator_stack.back ());
gdb_test "python print(gdb.lookup_type('simple::MoreComplicated').dynamic)" \
"True"
}
+
+# The new parser introduced an operator precedence bug.
+gdb_test "print 5 * 7 / 5" " = 7"
+gdb_test "print 4 - 3 - 1" " = 0"