Bug 28852 - [4.0/4.1/4.2 regression] ICE on invalid conversion operator
Summary: [4.0/4.1/4.2 regression] ICE on invalid conversion operator
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.2.0
: P3 normal
Target Milestone: 4.2.0
Assignee: Volker Reichelt
URL:
Keywords: error-recovery, ice-on-invalid-code, monitored
Depends on:
Blocks:
 
Reported: 2006-08-25 22:56 UTC by Volker Reichelt
Modified: 2006-08-26 00:30 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Reichelt 2006-08-25 22:56:12 UTC
Once again (see PR27547) the C++ frontend stumbles over an invalid operator:

========================
struct A
{
  operator int&(int);
};

A a;
int& i = a;
========================

n4.cc:3: error: 'A::operator int&(int)' must take 'void'
n4.cc:7: internal compiler error: Segmentation fault
Please submit a full bug report, [etc.]

This happens since GCC 3.3.4.

Posting a patch soon.
Comment 1 Volker Reichelt 2006-08-26 00:27:36 UTC
Subject: Bug 28852

Author: reichelt
Date: Sat Aug 26 00:25:59 2006
New Revision: 116463

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=116463
Log:
	PR c++/28852
	* cp-tree.h (grok_op_properties): Return bool instead of void.
	* decl.c (grokfndecl): Discard invalid operator declarations.
	(copy_fn_p): Revert change for PR 27547.
	(grok_op_properties): Return error status (true on success).
	* pt.c (tsubst_decl): Discard invalid operator declarations.

	* g++.dg/other/operator1.C: Add error-marker.
	* g++.dg/other/operator2.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/other/operator2.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/cp-tree.h
    trunk/gcc/cp/decl.c
    trunk/gcc/cp/pt.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/other/operator1.C

Comment 2 Volker Reichelt 2006-08-26 00:30:17 UTC
Fixed on mainline. WONTFIX on the branches, see
http://gcc.gnu.org/ml/gcc-patches/2006-08/msg00960.html