@@ -8478,7 +8478,7 @@ namespace {
84788478}
84798479
84808480template <class F >
8481- static Result accumulateStructMembers (const Scope* scope, F f, ValueType::Accuracy accuracy)
8481+ static Result accumulateStructMembers (const Scope* scope, F f, ValueType::Accuracy accuracy, const Settings& settings )
84828482{
84838483 size_t total = 0 ;
84848484 std::set<const Scope*> anonScopes;
@@ -8497,6 +8497,10 @@ static Result accumulateStructMembers(const Scope* scope, F f, ValueType::Accura
84978497 if (ret.second )
84988498 total = f (total, *vt, dim, bits);
84998499 }
8500+ else if (vt->container && vt->container ->startPattern == " std :: array <" ) {
8501+ const ValueType vtElement = ValueType::parseDecl (vt->containerTypeToken , settings);
8502+ total = f (total, vtElement, dim, bits);
8503+ }
85008504 else
85018505 total = f (total, *vt, dim, bits);
85028506 }
@@ -8536,12 +8540,12 @@ static size_t getAlignOf(const ValueType& vt, const Settings& settings, ValueTyp
85368540 size_t a = getAlignOf (vt2, settings, accuracy, ValueType::SizeOf::Pointer, ++maxRecursion);
85378541 return std::max (max, a);
85388542 };
8539- Result result = accumulateStructMembers (vt.typeScope , accHelper, accuracy);
8543+ Result result = accumulateStructMembers (vt.typeScope , accHelper, accuracy, settings );
85408544 size_t total = result.total ;
85418545 if (const Type* dt = vt.typeScope ->definedType ) {
85428546 total = std::accumulate (dt->derivedFrom .begin (), dt->derivedFrom .end (), total, [&](size_t v, const Type::BaseInfo& bi) {
85438547 if (bi.type && bi.type ->classScope )
8544- v += accumulateStructMembers (bi.type ->classScope , accHelper, accuracy).total ;
8548+ v += accumulateStructMembers (bi.type ->classScope , accHelper, accuracy, settings ).total ;
85458549 return v;
85468550 });
85478551 }
@@ -8629,14 +8633,14 @@ size_t ValueType::getSizeOf( const Settings& settings, Accuracy accuracy, SizeOf
86298633 }
86308634 return typeScope->type == ScopeType::eUnion ? std::max (total, n) : total + padding + n;
86318635 };
8632- Result result = accumulateStructMembers (typeScope, accHelper, accuracy);
8636+ Result result = accumulateStructMembers (typeScope, accHelper, accuracy, settings );
86338637 size_t total = result.total ;
86348638 if (currentBitCount > 0 )
86358639 total += currentBitfieldAlloc;
86368640 if (const ::Type* dt = typeScope->definedType ) {
86378641 total = std::accumulate (dt->derivedFrom .begin (), dt->derivedFrom .end (), total, [&](size_t v, const ::Type::BaseInfo& bi) {
86388642 if (bi.type && bi.type ->classScope )
8639- v += accumulateStructMembers (bi.type ->classScope , accHelper, accuracy).total ;
8643+ v += accumulateStructMembers (bi.type ->classScope , accHelper, accuracy, settings ).total ;
86408644 return v;
86418645 });
86428646 }
0 commit comments