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

* [Bug c++/23266] [4.0/4.1 regression] ICE on pure specifier for static method
  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 ` reichelt at gcc dot gnu dot org
  2005-08-11 22:46 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2005-08-06 23:57 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From reichelt at gcc dot gnu dot org  2005-08-06 23:57 -------
Testing a patch.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |reichelt at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED
   Target Milestone|---                         |4.0.2


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


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

* [Bug c++/23266] [4.0/4.1 regression] ICE on pure specifier for static method
  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
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-08-11 22:46 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-08-11 22:46 -------
Subject: Bug 23266

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	reichelt@gcc.gnu.org	2005-08-11 22:46:30

Modified files:
	gcc/cp         : ChangeLog decl2.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/inherit: pure1.C 

Log message:
	PR c++/23266
	* decl2.c (grokfield): Check that method is not static before
	marking it as pure.
	
	PR c++/23266
	* g++.dg/inherit/pure1.C: New test.
	
	* ChangeLog: Fix typos.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4847&r2=1.4848
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl2.c.diff?cvsroot=gcc&r1=1.793&r2=1.794
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5909&r2=1.5910
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/inherit/pure1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


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


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

* [Bug c++/23266] [4.0/4.1 regression] ICE on pure specifier for static method
  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
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-08-11 22:56 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-08-11 22:56 -------
Subject: Bug 23266

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-4_0-branch
Changes by:	reichelt@gcc.gnu.org	2005-08-11 22:55:22

Modified files:
	gcc/cp         : ChangeLog decl2.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/inherit: pure1.C 

Log message:
	PR c++/23266
	* decl2.c (grokfield): Check that method is not static before
	marking it as pure.
	
	PR c++/23266
	* g++.dg/inherit/pure1.C: New test.
	
	* ChangeLog: Fix typo.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.4648.2.75&r2=1.4648.2.76
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl2.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.770.2.3&r2=1.770.2.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.5084.2.330&r2=1.5084.2.331
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/inherit/pure1.C.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1



-- 


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


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

* [Bug c++/23266] [4.0/4.1 regression] ICE on pure specifier for static method
  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
                   ` (2 preceding siblings ...)
  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
  3 siblings, 0 replies; 5+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2005-08-11 22:57 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From reichelt at gcc dot gnu dot org  2005-08-11 22:57 -------
Fixed on mainline and 4.0 branch (for GCC 4.0.2).


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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