From e03ee8a24227fcd6bdf7efc87f604e83ed04f725 Mon Sep 17 00:00:00 2001 From: Steven Watanabe Date: Sat, 27 Dec 2008 22:04:21 +0000 Subject: [PATCH] Issue an error when set-default is called with a free or optional feature [SVN r50391] --- src/build/feature.jam | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/build/feature.jam b/src/build/feature.jam index f2960a5ef..4982524a4 100644 --- a/src/build/feature.jam +++ b/src/build/feature.jam @@ -161,6 +161,20 @@ rule feature ( rule set-default ( feature : value ) { local f = [ grist $(feature) ] ; + local a = $($(f).attributes) ; + local bad-attribute = ; + if free in $(a) + { + bad-attribute = free ; + } + else if optional in $(a) + { + bad-attribute = optional ; + } + if $(bad-attribute) + { + errors.error "$(bad-attribute) property $(f) cannot have a default." ; + } if ! $(value) in $($(f).values) { errors.error "The specified default value, '$(value)' is invalid"