From fab7d03508109bffb23cde8f46ed19e3d9400308 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 9 Aug 2021 13:10:37 +0200 Subject: Fix dependence on argument evaluation order in position test --- cli-tests/position/driver.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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; } -- cgit v1.1