Bug 38702 - [4.4 regression] ICE with defaulted operator
Summary: [4.4 regression] ICE with defaulted operator
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.4.0
: P2 normal
Target Milestone: 4.4.0
Assignee: Jason Merrill
URL:
Keywords: ice-on-invalid-code, monitored
Depends on:
Blocks:
 
Reported: 2009-01-02 14:58 UTC by Volker Reichelt
Modified: 2009-01-05 18:32 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2009-01-03 03:49:28


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Reichelt 2009-01-02 14:58:06 UTC
The following invalid code snippet triggers an ICE on the trunk:

=============================================
enum E { e }; 
 
E& operator |= (E&, const E&) = default;
=============================================

bug5.cc:3: internal compiler error: in copy_fn_p, at cp/decl.c:9717
Please submit a full bug report, [etc.]

This is related to PR38701. It's not a duplicate though, because the ICE
appeared already in July and it's not an error-recovery problem.
Comment 1 Paolo Carlini 2009-01-02 15:30:29 UTC
Likewise...
Comment 2 Andrew Pinski 2009-01-02 20:08:11 UTC
Confirmed.
Comment 3 Jason Merrill 2009-01-05 17:52:30 UTC
Subject: Bug 38702

Author: jason
Date: Mon Jan  5 17:52:18 2009
New Revision: 143081

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=143081
Log:
        PR c++/38701
        * decl.c (cp_finish_decl): Clear DECL_INITIAL for invalid
        defaulting.

        PR c++/38702
        * class.c (defaultable_fn_p): Only operator== can be a copy
        assignment operator.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/defaulted7.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/class.c
    trunk/gcc/cp/decl.c
    trunk/gcc/testsuite/ChangeLog

Comment 4 Jason Merrill 2009-01-05 17:52:49 UTC
Subject: Bug 38702

Author: jason
Date: Mon Jan  5 17:52:35 2009
New Revision: 143082

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=143082
Log:
        PR c++/38701
        * decl.c (cp_finish_decl): Clear DECL_INITIAL for invalid
        defaulting.

        PR c++/38702
        * class.c (defaultable_fn_p): Only operator== can be a copy
        assignment operator.

Modified:
    trunk/gcc/cp/cp-tree.h

Comment 5 Jakub Jelinek 2009-01-05 18:32:20 UTC
Fixed.