aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2023-11-17 07:30:37 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2023-11-17 07:30:37 +0200
commit495de53eb379eff3cf998b210f7472619741e037 (patch)
treef55b28ad046019a4fbc1630e4b8e772c5b9826c2
parent23b059eea0618220010b30bacbf97db7f642c870 (diff)
Add pre-condition assert to target::newer()
-rw-r--r--libbuild2/target.ixx2
1 files changed, 2 insertions, 0 deletions
diff --git a/libbuild2/target.ixx b/libbuild2/target.ixx
index 69b2776..39b81e7 100644
--- a/libbuild2/target.ixx
+++ b/libbuild2/target.ixx
@@ -769,6 +769,8 @@ namespace build2
inline bool mtime_target::
newer (timestamp mt, target_state s) const
{
+ assert (s != target_state::unknown); // Should be executed.
+
timestamp mp (mtime ());
// What do we do if timestamps are equal? This can happen, for example,