From 6a78346cf7e755a9f5a206ca9011694bf073ea12 Mon Sep 17 00:00:00 2001 From: Bob Hood Date: Mon, 17 Aug 2026 11:58:51 -0600 Subject: [PATCH] Avoid implicit StrictNumeric conversion in a new[] size expression CheckedNumeric::ValueOrDie() returns StrictNumeric, whose conversion to Dst is a template with a deduced parameter. GCC cannot deduce it when the value is used as the size expression of a new[], failing with: error: default type conversion cannot deduce template argument for 'template constexpr StrictNumeric::operator Dst() const' Note that spelling out ValueOrDie's own template argument does not help, since the unconvertible value is its StrictNumeric return type rather than the call itself. Cast explicitly instead, which gives the conversion operator a concrete destination type. Compile-only change; checkedArraySize is already a CheckedNumeric. --- src/compiler/translator/IntermNode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/translator/IntermNode.cpp b/src/compiler/translator/IntermNode.cpp index 710bba9..33d4a64 100644 --- a/src/compiler/translator/IntermNode.cpp +++ b/src/compiler/translator/IntermNode.cpp @@ -880,7 +880,7 @@ const TConstantUnion *TIntermAggregate::getConstantValue() const // http://crbug.com/498400132 angle::base::CheckedNumeric checkedArraySize = elementSize; checkedArraySize *= getOutermostArraySize(); - constArray = new TConstantUnion[checkedArraySize.ValueOrDie()]; + constArray = new TConstantUnion[static_cast(checkedArraySize.ValueOrDie())]; size_t elementOffset = 0u; for (TIntermNode *constructorArg : mArguments) -- 2.43.0