public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/23266] New: [4.0/4.1 regression] ICE on pure specifier for static method
@ 2005-08-06 23:56 reichelt at gcc dot gnu dot org
  2005-08-06 23:57 ` [Bug c++/23266] " reichelt at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2005-08-06 23:56 UTC (permalink / raw)
  To: gcc-bugs

The following invalid testcase triggers an ICE since gcc 4.0.0:

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

The error message is:

  bug.cc:3: internal compiler error: in grokfield, at cp/decl2.c:899
  Please submit a full bug report, [etc.]

The respective code from cp/decl2.c reads:

   /* Initializers for functions are rejected early in the parser.
      If we get here, it must be a pure specifier for a method.  */
   gcc_assert (TREE_CODE (TREE_TYPE (value)) == METHOD_TYPE);
   gcc_assert (error_operand_p (init) || integer_zerop (init));
   DECL_PURE_VIRTUAL_P (value) = 1;

Apparently the first assert is triggered - we have a FUNCTION_TYPE
instead of a METHOD_TYPE in this example. This was probably broken by
Giovanni's patch for PR17401.

-- 
           Summary: [4.0/4.1 regression] ICE on pure specifier for static
                    method
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code, monitored
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org,giovannibajo at libero
                    dot it


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


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

end of thread, other threads:[~2005-08-11 22:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-06 23:56 [Bug c++/23266] New: [4.0/4.1 regression] ICE on pure specifier for static method reichelt at gcc dot gnu dot org
2005-08-06 23:57 ` [Bug c++/23266] " reichelt at gcc dot gnu dot org
2005-08-11 22:46 ` cvs-commit at gcc dot gnu dot org
2005-08-11 22:56 ` cvs-commit at gcc dot gnu dot org
2005-08-11 22:57 ` reichelt at gcc dot gnu dot 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).