From 4ce9366b563ceb4939403dbf498b6a5126661ee0 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 9 Aug 2018 09:34:24 +0200 Subject: Fix issue with concatenating empty typed LHS --- build2/parser.cxx | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/build2/parser.cxx b/build2/parser.cxx index d2cf38a..caf970e 100644 --- a/build2/parser.cxx +++ b/build2/parser.cxx @@ -3510,10 +3510,21 @@ namespace build2 if (!vnull) { - untypify (rhs); + if (vtype != nullptr) + untypify (rhs); + names& d (rhs.as ()); - assert (d.size () == 1); // Must be single value. - concat_data = move (d[0]); + + // If the value is empty, then untypify() will (typically; no pun + // intended) represent it as an empty sequence of names rather than + // a sequence of one empty name. This is usually what we need (see + // simple_reverse() for details) but not in this case. + // + if (!d.empty ()) + { + assert (d.size () == 1); // Must be a single value. + concat_data = move (d[0]); + } } }; -- cgit v1.1