public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/51431] New: [4.5/4.6/4.7 Regression] ICE with invalid use of abstract class
@ 2011-12-06  0:44 reichelt at gcc dot gnu.org
  2011-12-06  0:45 ` [Bug c++/51431] [4.4/4.5/4.6/4.7 " reichelt at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: reichelt at gcc dot gnu.org @ 2011-12-06  0:44 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 51431
           Summary: [4.5/4.6/4.7 Regression] ICE with invalid use of
                    abstract class
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          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.4.0:

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

struct B
{
  A a;
  B() : a() {}
};
===================================

bug.cc:8:5: error: cannot declare field 'B::a' to be of abstract type 'A'
bug.cc:1:8: note:   because the following virtual functions are pure within
'A':
bug.cc:3:16: note:   virtual void A::foo()
bug.cc: In constructor 'B::B()':
bug.cc:9:11: error: cannot allocate an object of abstract type 'A'
bug.cc:1:8: note:   since type 'A' has pure virtual functions
bug.cc:9:11: internal compiler error: tree check: expected aggr_init_expr, have
error_mark in build_value_init, at cp/init.c:365
Please submit a full bug report, [etc.]


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-12-07  7:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-06  0:44 [Bug c++/51431] New: [4.5/4.6/4.7 Regression] ICE with invalid use of abstract class reichelt at gcc dot gnu.org
2011-12-06  0:45 ` [Bug c++/51431] [4.4/4.5/4.6/4.7 " reichelt at gcc dot gnu.org
2011-12-06 14:29 ` rguenth at gcc dot gnu.org
2011-12-06 16:29 ` paolo.carlini at oracle dot com
2011-12-06 17:13 ` paolo at gcc dot gnu.org
2011-12-06 17:15 ` [Bug c++/51431] [4.4/4.5/4.6 " paolo.carlini at oracle dot com
2011-12-06 17:15 ` paolo.carlini at oracle dot com
2011-12-07  7:43 ` [Bug c++/51431] [4.7 " reichelt at gcc dot gnu.org

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