summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2023-04-27 09:45:40 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2023-04-28 14:01:46 +0000
commit7870b80ff70089937a6e7f03d99bd40e808c0242 (patch)
tree9e312a1a2b043de994252cf091f2da1564f2a6a8
parent70189916933cffaa3c2ed767d82f6a7d524a164e (diff)
downloadqbs-7870b80ff70089937a6e7f03d99bd40e808c0242.tar.gz
Fix Value copy constructor
We forgot a member, which manifested itself when using module properties whose value referred to "original" on the group level. Also fix a check in Evaluator that prevented us from even trying to evaluate such properties. Amends fb52fed84a1510a7de0172e643d6fd66a780e2e8. Change-Id: I73cae5e6d9603f277862a1ccc8ea8f676d6a5ab1 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
-rw-r--r--src/lib/corelib/language/evaluator.cpp3
-rw-r--r--src/lib/corelib/language/value.cpp2
-rw-r--r--tests/auto/language/testdata/modulepropertiesingroups.qbs9
3 files changed, 13 insertions, 1 deletions
diff --git a/src/lib/corelib/language/evaluator.cpp b/src/lib/corelib/language/evaluator.cpp
index 3d4c98a79..833ab96f2 100644
--- a/src/lib/corelib/language/evaluator.cpp
+++ b/src/lib/corelib/language/evaluator.cpp
@@ -570,7 +570,8 @@ private:
if (data->item->propertyDeclaration(*propertyName).isScalar()) {
const Item *item = itemOfProperty;
- if (item->type() != ItemType::ModuleInstance) {
+ if (item->type() != ItemType::ModuleInstance
+ && item->type() != ItemType::ModuleInstancePlaceholder) {
const QString errorMessage = Tr::tr("The special value 'original' can only "
"be used with module properties.");
extraScope = throwError(engine->context(), errorMessage);
diff --git a/src/lib/corelib/language/value.cpp b/src/lib/corelib/language/value.cpp
index 7ba9ff384..fabc64ccd 100644
--- a/src/lib/corelib/language/value.cpp
+++ b/src/lib/corelib/language/value.cpp
@@ -57,7 +57,9 @@ Value::Value(Type t, bool createdByPropertiesBlock) : m_type(t)
Value::Value(const Value &other)
: m_type(other.m_type),
m_scope(other.m_scope),
+ m_scopeName(other.m_scopeName),
m_next(other.m_next ? other.m_next->clone() : ValuePtr()),
+ m_candidates(other.m_candidates),
m_flags(other.m_flags)
{
}
diff --git a/tests/auto/language/testdata/modulepropertiesingroups.qbs b/tests/auto/language/testdata/modulepropertiesingroups.qbs
index e3857bdf4..49f24c0ca 100644
--- a/tests/auto/language/testdata/modulepropertiesingroups.qbs
+++ b/tests/auto/language/testdata/modulepropertiesingroups.qbs
@@ -80,4 +80,13 @@ Project {
}
}
}
+
+ Product {
+ name: "module-property-in-group-condition"
+ Depends { name: "cpp" }
+ Group {
+ condition: qbs.architecture === "x86_64"
+ cpp.includePaths: "."
+ }
+ }
}