#1056341 g++-12: rejects valid C++ with templates/auto

Package:
g++-12
Source:
g++-12
Description:
GNU C++ compiler
Submitter:
David Turner
Date:
2023-11-21 11:39:04 UTC
Severity:
normal
Tags:
#1056341#5
Date:
2023-11-21 11:35:34 UTC
From:
To:
Dear Maintainer,

The attached C++ file fails to compile in GCC 12.2 using the command
`g++ --std=c++17 -c 1862683_reproducer.cpp`, but works correctly with 12.3 and
with clang (godbolt link: https://godbolt.org/z/q4dGbTcvb).

I came across this while building Firefox for Raspberry Pi OS using the Debian
packaging scripts - this bug prevents Firefox from being built on Debian stable
using GCC (the reproducer is simplified down from Firefox 119).

Given this works in 12.3 it's almost certainly known and fixed upstream, but
I'm not sure which upstream problem report would apply (possibly 106893 or
105623?).  Please could the fix for this be backported to stable?

Kind regards,
David