Bug 26071 - [4.0/4.1/4.2 regression] ICE declaring destructor virtual and static
Summary: [4.0/4.1/4.2 regression] ICE declaring destructor virtual and static
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.2.0
: P3 normal
Target Milestone: 4.0.3
Assignee: Volker Reichelt
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords: ice-on-invalid-code, monitored, patch
Depends on:
Blocks:
 
Reported: 2006-02-02 09:00 UTC by Volker Reichelt
Modified: 2006-02-08 11:27 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-02-02 09:07:41


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Reichelt 2006-02-02 09:00:57 UTC
The following invalid code snippet causes an ICE:

===============================
struct A
{
  virtual static ~A();
};
===============================

  '
  Segmentation fault
  Please submit a full bug report, [etc.]

This a regression from GCC 3.4.x. Before we got the error message:

  bug.cc:3: error: member `A' cannot be declared both virtual and static

which is not quite correct, but tolerable.

Will post patch soon.
Comment 1 Volker Reichelt 2006-02-08 11:21:31 UTC
Subject: Bug 26071

Author: reichelt
Date: Wed Feb  8 11:21:27 2006
New Revision: 110751

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=110751
Log:
	PR c++/26071
	* decl.c (grokdeclarator): Set dname also for destructor.

	* g++.dg/other/virtual2.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/other/virtual2.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/decl.c
    trunk/gcc/testsuite/ChangeLog

Comment 2 Volker Reichelt 2006-02-08 11:23:21 UTC
Subject: Bug 26071

Author: reichelt
Date: Wed Feb  8 11:23:17 2006
New Revision: 110752

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=110752
Log:
	PR c++/26071
	* decl.c (grokdeclarator): Set dname also for destructor.

	* g++.dg/other/virtual2.C: New test.

Added:
    branches/gcc-4_1-branch/gcc/testsuite/g++.dg/other/virtual2.C
Modified:
    branches/gcc-4_1-branch/gcc/cp/ChangeLog
    branches/gcc-4_1-branch/gcc/cp/decl.c
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog

Comment 3 Volker Reichelt 2006-02-08 11:26:30 UTC
Subject: Bug 26071

Author: reichelt
Date: Wed Feb  8 11:26:25 2006
New Revision: 110753

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=110753
Log:
	PR c++/26071
	* decl.c (grokdeclarator): Set dname also for destructor.

	* g++.dg/other/virtual2.C: New test.

Added:
    branches/gcc-4_0-branch/gcc/testsuite/g++.dg/other/virtual2.C
Modified:
    branches/gcc-4_0-branch/gcc/cp/ChangeLog
    branches/gcc-4_0-branch/gcc/cp/decl.c
    branches/gcc-4_0-branch/gcc/testsuite/ChangeLog

Comment 4 Volker Reichelt 2006-02-08 11:27:49 UTC
Fixed on mainline, 4.1 branch, and 4.0 branch.