public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "reichelt at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/51223] New: [4.5/4.6/4.7 Regression] ICE with invalid function parameter
Date: Sat, 19 Nov 2011 19:34:00 -0000	[thread overview]
Message-ID: <bug-51223-4@http.gcc.gnu.org/bugzilla/> (raw)

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51223

             Bug #: 51223
           Summary: [4.5/4.6/4.7 Regression] ICE with invalid function
                    parameter
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: reichelt@gcc.gnu.org


The following invalid code snippet triggers an ICE since GCC 4.5.0:

==========================
struct A
{
  A foo(void i = 0);
};

void bar()
{
  A().foo();
}

A A::foo(void i)
{
  return A();
}
==========================

bug.cc:3:18: error: 'i' has incomplete type
bug.cc:3:19: error: invalid use of 'void'
bug.cc: In function 'void bar()':
bug.cc:8:11: error: call to 'A A::foo(<type error>)' uses the default argument
for parameter 1, which is not yet defined
bug.cc: At global scope:
bug.cc:11:15: error: 'i' has incomplete type
bug.cc:11:16: error: invalid use of 'void'
bug.cc: In function 'void bar()':
bug.cc:8:11: internal compiler error: tree check: expected class 'type', have
'exceptional' (error_mark) in useless_type_conversion_p, at tree-ssa.c:1460
Please submit a full bug report, [etc.]


             reply	other threads:[~2011-11-19 19:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-19 19:34 reichelt at gcc dot gnu.org [this message]
2011-12-05 14:15 ` [Bug c++/51223] " rguenth at gcc dot gnu.org
2011-12-06 14:03 ` rguenth at gcc dot gnu.org
2012-01-01 22:14 ` pinskia at gcc dot gnu.org
2012-01-23 18:58 ` paolo.carlini at oracle dot com
2012-01-24 10:51 ` paolo at gcc dot gnu.org
2012-01-24 10:55 ` [Bug c++/51223] [4.5/4.6 " paolo.carlini at oracle dot com

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-51223-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).