From c9a1f605f091d8d638fac044d9d0ead0aa79496b Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Tue, 17 Dec 2002 14:15:07 +0000 Subject: [PATCH] Bug fix [SVN r16637] --- src/build/feature.jam | 46 ++++++++++++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/src/build/feature.jam b/src/build/feature.jam index 15add2e02..87357b29e 100644 --- a/src/build/feature.jam +++ b/src/build/feature.jam @@ -506,29 +506,45 @@ rule expand-composites ( properties * ) # now expand composite features for local p in $(properties) { - for local x in [ expand-composite $(p) ] + local expanded = [ expand-composite $(p) ] ; + + for local x in $(expanded) { if ! $(x) in $(result) { - if $(x:G) in $(free.features) + local f = $(x:G) ; + + if $(f) in $(free.features) { result += $(x) ; } - else if $(x:G) in $(result:G) + else if ! $(x) in $(properties) # x is the result of expansion + { + if ! $(f) in $(explicit-features) # not explicitly-specified + { + if $(f) in $(result:G) + { + error expansions of composite features result in conflicting + values for $(f) + : values: [ get-values $(f) : $(result) ] $(x:G=) + : one contributing composite property was $(p) ; + } + else + { + result += $(x) ; + } + } + } + else if $(f) in $(result:G) { error explicitly-specified values of non-free feature - $(x:G) conflict : - values: [ get-values $(x:G) : $(properties) ] ; + $(f) conflict : + values: [ get-values $(f) : $(properties) ] $(x:G=) ; } - else if - # if it's not the result of composite expansion - $(x) in $(properties) - # or it is, but it doesn't match any explicitly-specified feature - || ( ! $(x:G) in $(explicit-features) ) + else { result += $(x) ; } - } } } return $(result) ; @@ -795,11 +811,9 @@ local rule __test__ ( ) : expand debug on ; - # This tests fails. I'm comitting it commented out to not break all - # the tests. - #assert.result on debug _DEBUG - # : expand on debug - # ; + assert.result on debug _DEBUG + : expand on debug + ; assert.result dynamic on : defaults