Bug 34488 - [4.3 regression] ICE on invalid friend declaration
Summary: [4.3 regression] ICE on invalid friend declaration
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: 4.3.0
Assignee: Jakub Jelinek
URL:
Keywords: error-recovery, ice-on-invalid-code, monitored
Depends on:
Blocks:
 
Reported: 2007-12-15 22:58 UTC by Volker Reichelt
Modified: 2007-12-18 00:29 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2007-12-17 14:07:16


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Reichelt 2007-12-15 22:58:13 UTC
The following invalid testcase triggers an ICE on mainline:

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

bug.cc:3: error: return type specification for constructor invalid
bug.cc: In static member function 'static A::A()':
bug.cc:3: internal compiler error: Segmentation fault
Please submit a full bug report, [etc.]
Comment 1 Jakub Jelinek 2007-12-16 21:30:54 UTC
I guess this is caused by r123312.
Comment 2 Jakub Jelinek 2007-12-17 14:07:16 UTC
And related to PR22293.  Testing a fix.
Comment 3 Jakub Jelinek 2007-12-18 00:15:44 UTC
Subject: Bug 34488

Author: jakub
Date: Tue Dec 18 00:15:32 2007
New Revision: 131025

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=131025
Log:
	PR c++/34488
	* decl.c (grokdeclarator): Reject friend sfk_constructor
	FUNCTION_TYPE.

	* g++.dg/parse/friend7.C: New test.

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

Comment 4 Jakub Jelinek 2007-12-18 00:29:30 UTC
Fixed.