From dbb7a5ffefefa1e6439464cac47ebfd90a913aa7 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 8 Nov 2018 12:45:33 +0200 Subject: Fix bug in override logic for command line variable with project visibility --- build2/scope.ixx | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'build2/scope.ixx') diff --git a/build2/scope.ixx b/build2/scope.ixx index 9a93e9d..ac71e82 100644 --- a/build2/scope.ixx +++ b/build2/scope.ixx @@ -39,4 +39,16 @@ namespace build2 for (; r->parent_->root_ != nullptr; r = r->parent_->root_) ; return r; } + + inline bool scope:: + sub_root (const scope& r) const + { + // Scan the parent root scope chain looking for this scope. + // + for (const scope* pr (&r); (pr = pr->parent_->root_) != nullptr; ) + if (pr == this) + return true; + + return false; + } } -- cgit v1.1