Fixes #1577

Apologies for the combinatorial explosion of tests but it was the easiest way to be sure.

Tests are for binary expressions of each type - same precedence (+, -), greater precedence (*) and lower precedence (&), for both outside and inside the template expression.