@@ -8476,7 +8476,7 @@ namespace {
84768476}
84778477
84788478template <class F >
8479- static Result accumulateStructMembers (const Scope* scope, F f, ValueType::Accuracy accuracy)
8479+ static Result accumulateStructMembers (const Scope* scope, F f, ValueType::Accuracy accuracy, const Settings& settings )
84808480{
84818481 size_t total = 0 ;
84828482 std::set<const Scope*> anonScopes;
@@ -8495,6 +8495,10 @@ static Result accumulateStructMembers(const Scope* scope, F f, ValueType::Accura
84958495 if (ret.second )
84968496 total = f (total, *vt, dim, bits);
84978497 }
8498+ else if (vt->container && vt->container ->startPattern == " std :: array <" ) {
8499+ const ValueType vtElement = ValueType::parseDecl (vt->containerTypeToken , settings);
8500+ total = f (total, vtElement, dim, bits);
8501+ }
84988502 else
84998503 total = f (total, *vt, dim, bits);
85008504 }
@@ -8534,12 +8538,12 @@ static size_t getAlignOf(const ValueType& vt, const Settings& settings, ValueTyp
85348538 size_t a = getAlignOf (vt2, settings, accuracy, ValueType::SizeOf::Pointer, ++maxRecursion);
85358539 return std::max (max, a);
85368540 };
8537- Result result = accumulateStructMembers (vt.typeScope , accHelper, accuracy);
8541+ Result result = accumulateStructMembers (vt.typeScope , accHelper, accuracy, settings );
85388542 size_t total = result.total ;
85398543 if (const Type* dt = vt.typeScope ->definedType ) {
85408544 total = std::accumulate (dt->derivedFrom .begin (), dt->derivedFrom .end (), total, [&](size_t v, const Type::BaseInfo& bi) {
85418545 if (bi.type && bi.type ->classScope )
8542- v += accumulateStructMembers (bi.type ->classScope , accHelper, accuracy).total ;
8546+ v += accumulateStructMembers (bi.type ->classScope , accHelper, accuracy, settings ).total ;
85438547 return v;
85448548 });
85458549 }
@@ -8627,14 +8631,14 @@ size_t ValueType::getSizeOf( const Settings& settings, Accuracy accuracy, SizeOf
86278631 }
86288632 return typeScope->type == ScopeType::eUnion ? std::max (total, n) : total + padding + n;
86298633 };
8630- Result result = accumulateStructMembers (typeScope, accHelper, accuracy);
8634+ Result result = accumulateStructMembers (typeScope, accHelper, accuracy, settings );
86318635 size_t total = result.total ;
86328636 if (currentBitCount > 0 )
86338637 total += currentBitfieldAlloc;
86348638 if (const ::Type* dt = typeScope->definedType ) {
86358639 total = std::accumulate (dt->derivedFrom .begin (), dt->derivedFrom .end (), total, [&](size_t v, const ::Type::BaseInfo& bi) {
86368640 if (bi.type && bi.type ->classScope )
8637- v += accumulateStructMembers (bi.type ->classScope , accHelper, accuracy).total ;
8641+ v += accumulateStructMembers (bi.type ->classScope , accHelper, accuracy, settings ).total ;
86388642 return v;
86398643 });
86408644 }
0 commit comments