summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2021-08-09 13:10:37 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2021-08-09 13:10:37 +0200
commitfab7d03508109bffb23cde8f46ed19e3d9400308 (patch)
treed7af70de88510aa769a0e1f2b3b26b18a5429523
parent0426335af0e7577148903be7a2534c4ced06cd3b (diff)
Fix dependence on argument evaluation order in position test
-rw-r--r--cli-tests/position/driver.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/cli-tests/position/driver.cxx b/cli-tests/position/driver.cxx
index 77b9a8d..eebb5d0 100644
--- a/cli-tests/position/driver.cxx
+++ b/cli-tests/position/driver.cxx
@@ -27,7 +27,13 @@ main (int argc, char* argv[])
}
while (scan.more ())
- cout << scan.position () << ": " << scan.next () << endl;
+ {
+ // Note that calling position() inside `cout << ...` depends on order of
+ // argument evaluation.
+ //
+ size_t p (scan.position ());
+ cout << p << ": " << scan.next () << endl;
+ }
cout << "max: " << scan.position () << endl;
}