aboutsummaryrefslogtreecommitdiff
path: root/libbuild2
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-07-13 15:37:43 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-07-13 15:37:43 +0200
commitbf0ab18ec2c6364b814d18d24edad6e9a882be20 (patch)
tree8402cfec1a69b3ea5145c0c22172e2c976aba9af /libbuild2
parent1e2d121acbc883305296f5034520c42e975b4541 (diff)
Fix version check in using directive
Diffstat (limited to 'libbuild2')
-rw-r--r--libbuild2/parser.cxx17
1 files changed, 9 insertions, 8 deletions
diff --git a/libbuild2/parser.cxx b/libbuild2/parser.cxx
index 711c5f0..53ff7f7 100644
--- a/libbuild2/parser.cxx
+++ b/libbuild2/parser.cxx
@@ -2723,9 +2723,9 @@ namespace build2
{
tracer trace ("parser::parse_using", &path_);
- bool optional (t.value.back () == '?');
+ bool opt (t.value.back () == '?');
- if (optional && stage_ == stage::boot)
+ if (opt && stage_ == stage::boot)
fail (t) << "optional module in bootstrap";
// The rest should be a list of module names. Parse them as names in the
@@ -2741,7 +2741,7 @@ namespace build2
for (auto i (ns.begin ()); i != ns.end (); ++i)
{
string n;
- standard_version v;
+ optional<standard_version> v;
if (!i->simple ())
fail (l) << "expected module name instead of " << *i;
@@ -2769,19 +2769,20 @@ namespace build2
//
if (n == "build")
{
- standard_version_constraint c (move (v), false, nullopt, true); // >=
-
- if (!v.empty ())
+ if (v)
+ {
+ standard_version_constraint c (move (v), false, nullopt, true); // >=
check_build_version (c, l);
+ }
}
else
{
- assert (v.empty ()); // Module versioning not yet implemented.
+ assert (!v); // Module versioning not yet implemented.
if (stage_ == stage::boot)
boot_module (*root_, n, l);
else
- init_module (*root_, *scope_, n, l, optional);
+ init_module (*root_, *scope_, n, l, opt);
}
}