https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101833
Bug ID: 101833
Summary: [9/10/11/12 Regression] ICE with -Wformat on a
constructor with a virtual base
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: pinskia at gcc dot gnu.org
Target Milestone: ---
Take:
class Base {};
struct VDerived : virtual Base
{
VDerived(int x, const char * f, ...)
__attribute__((format(printf, 5, 6)));
} a(1, "%s %d", "foo", 1);
----- CUT ----
We get an ICE:
<source>:5:26: warning: 'format' attribute argument 2 value '5' exceeds the
number of function parameters 3 [-Wattributes]
5 | } a(1, "%s %d", "foo", 1);
| ^
<source>:5:26: internal compiler error: in get_constant, at
c-family/c-format.c:325
0x1dbb089 internal_error(char const*, ...)
This started in 9.1.0