Bug 37647 - [4.3 regression] ICE with invalid use of constructor
Summary: [4.3 regression] ICE with invalid use of constructor
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.4.0
: P4 minor
Target Milestone: 4.4.0
Assignee: Simon Martin
URL:
Keywords: error-recovery, ice-on-invalid-code, monitored
Depends on:
Blocks:
 
Reported: 2008-09-25 07:05 UTC by Volker Reichelt
Modified: 2009-04-22 15:28 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Known to work: 4.2.4 4.4.0
Known to fail: 4.3.0 4.3.3
Last reconfirmed: 2008-12-31 22:11:18


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Reichelt 2008-09-25 07:05:35 UTC
The following invalid code snippet triggers an ICE since GCC 4.3.0:

==========================
struct A
{
  A() { void A(); }
};
==========================

bug.cc: In constructor 'A::A()':
bug.cc:3: error: return type specification for constructor invalid
bug.cc:3: internal compiler error: in copy_fn_p, at cp/decl.c:9677
Please submit a full bug report, [etc.]
Comment 1 Andrew Pinski 2008-09-28 19:54:19 UTC
Confirmed.
Comment 2 Simon Martin 2008-10-02 19:42:54 UTC
Introduced by my fix for PR29077
Comment 3 Simon Martin 2008-10-03 03:38:15 UTC
Patch submitted here
  http://gcc.gnu.org/ml/gcc-patches/2008-10/msg00079.html
Comment 4 Richard Biener 2009-01-24 10:20:53 UTC
GCC 4.3.3 is being released, adjusting target milestone.
Comment 5 andreasmeier80 2009-03-27 07:17:49 UTC
Approved patch: http://gcc.gnu.org/ml/gcc-patches/2009-03/msg01080.html
Comment 6 hjl@gcc.gnu.org 2009-03-27 13:17:54 UTC
Subject: Bug 37647

Author: hjl
Date: Fri Mar 27 13:17:37 2009
New Revision: 145105

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=145105
Log:
gcc/cp/

2009-03-27  Simon Martin  <simartin@users.sourceforge.net>

	PR c++/37647
	* decl.c (grokdeclarator): Reject [con|de]stuctors in a non-class
	scope.

gcc/testsuite/

2009-03-27  Simon Martin  <simartin@users.sourceforge.net>

	PR c++/37647
	* g++.dg/parse/ctor9.C: New test.

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

Comment 7 Richard Biener 2009-04-22 15:28:40 UTC
WONTFIX for 4.3.