Backport upstream patch to fix build with GCC 9

Closes: #925813.

Merge request reports

Loading