aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-01-24 10:47:42 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-01-24 10:47:42 +0200
commit4b507ea962169a8d19e4b37b940448eba97d87a4 (patch)
treea578200f74fceebde98d5b18cf410166ae2e45b6
parent724ed2aaab1754bdc13215e707c04533752fe95b (diff)
If base target type doesn't use extensions, don't use them in derived
-rw-r--r--build2/parser.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/build2/parser.cxx b/build2/parser.cxx
index c632c80..b28f4f6 100644
--- a/build2/parser.cxx
+++ b/build2/parser.cxx
@@ -937,9 +937,13 @@ namespace build2
dt->factory = &derived_factory;
// Override extension derivation function: we most likely don't want
- // to use the same default as our base (think cli: file).
+ // to use the same default as our base (think cli: file). But, if our
+ // base doesn't use extensions, then most likely neither do we (think
+ // foo: alias).
//
- dt->extension = &target_extension_var<derived_ext_var, nullptr>;
+ dt->extension = /*bt->extension == nullptr
+ ? nullptr
+ :*/ &target_extension_var<derived_ext_var, nullptr>;
target_type& rdt (*dt); // Save a non-const reference to the object.