public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/101833] New: [9/10/11/12 Regression] ICE with -Wformat on a constructor with a virtual base
Date: Mon, 09 Aug 2021 18:25:15 +0000	[thread overview]
Message-ID: <bug-101833-4@http.gcc.gnu.org/bugzilla/> (raw)

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

             reply	other threads:[~2021-08-09 18:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-09 18:25 pinskia at gcc dot gnu.org [this message]
2021-08-09 18:25 ` [Bug c++/101833] " pinskia at gcc dot gnu.org
2021-08-10  7:34 ` marxin at gcc dot gnu.org
2021-08-12 23:38 ` msebor at gcc dot gnu.org
2022-01-17 13:57 ` rguenth at gcc dot gnu.org
2022-03-31 22:02 ` mpolacek at gcc dot gnu.org
2022-05-07 14:44 ` [Bug c++/101833] [9/10/11/12/13 " cvs-commit at gcc dot gnu.org
2022-05-07 14:59 ` [Bug c++/101833] [9/10/11/12 " mpolacek at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-101833-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).