Skip to content

Commit cb0ef4a

Browse files
committed
Fix window build failure
1 parent 9dd0b64 commit cb0ef4a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

flang/lib/Semantics/compute-offsets.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,15 @@ static bool isReal8OrLarger(const Fortran::semantics::DeclTypeSpec *type) {
8282
// type, the alignment is computed accordingly.
8383
std::optional<size_t> ComputeOffsetsHelper::CompAlignment(const Symbol &sym) {
8484
size_t max_align{0};
85+
constexpr size_t fourByteAlign{4};
8586
bool contain_double{false};
8687
auto derivedTypeSpec{sym.GetType()->AsDerived()};
8788
DirectComponentIterator directs{*derivedTypeSpec};
8889
for (auto it{directs.begin()}; it != directs.end(); ++it) {
8990
auto type{it->GetType()};
9091
auto s{GetSizeAndAlignment(*it, true)};
9192
if (isReal8OrLarger(type)) {
92-
max_align = std::max(max_align, 4UL);
93+
max_align = std::max(max_align, fourByteAlign);
9394
contain_double = true;
9495
} else if (type->AsDerived()) {
9596
if (const auto newAlgin{CompAlignment(*it)}) {

0 commit comments

Comments
 (0)