diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2021-08-09 13:10:37 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2021-08-09 13:10:37 +0200 |
commit | fab7d03508109bffb23cde8f46ed19e3d9400308 (patch) | |
tree | d7af70de88510aa769a0e1f2b3b26b18a5429523 | |
parent | 0426335af0e7577148903be7a2534c4ced06cd3b (diff) |
Fix dependence on argument evaluation order in position test
-rw-r--r-- | cli-tests/position/driver.cxx | 8 |
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; } |