Bug 48726 - [C++0x] [4.6 Regression] ICE with initializer_list of unique_ptr
[C++0x] [4.6 Regression] ICE with initializer_list of unique_ptr
Status: RESOLVED FIXED
Product: gcc
Classification: Unclassified
Component: c++
4.6.0
: P3 normal
: 4.6.1
Assigned To: Jason Merrill
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-04-22 14:39 UTC by John Salmon
Modified: 2011-04-26 23:43 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2011-04-22 16:30:27


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Salmon 2011-04-22 14:39:51 UTC
The following code generates an ICE while trying to create a std::initializer_list of unique_ptrs.  This is with Target=x86_64-unknown-linux-gnu.

salmonj@drdlogin0039.en.desres$ cat il.cpp
#include <memory>

struct Foo{
    int i;
};
typedef std::unique_ptr<Foo> up;

std::initializer_list<up> il{up{new Foo}, up{new Foo}};

salmonj@drdlogin0039.en.desres$ desres-cleanenv -m gcc/4.6.0-23A/bin g++ -std=c++0x -Wall -c -o il.o il.cpp
il.cpp:8:55: internal compiler error: in record_reference, at cgraphbuild.c:60
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
salmonj@drdlogin0039.en.desres$
Comment 1 Jonathan Wakely 2011-04-22 15:56:48 UTC
if this is PR 48281 then it's fixed in 4.6.1
Comment 2 Paolo Carlini 2011-04-22 16:26:19 UTC
Maybe it isn't? Because I just rebuilt 4_6-branch (Rev. 172860) and still ICEs for me. Mainline is fine, however.
Comment 3 Paolo Carlini 2011-04-22 16:30:27 UTC
Let's mark it as a regression too, to play safe.
Comment 4 Jason Merrill 2011-04-26 23:42:53 UTC
Author: jason
Date: Tue Apr 26 23:42:50 2011
New Revision: 172993

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=172993
Log:
	PR c++/48726
	* call.c (convert_like_real): Correct TREE_CONSTANT on CONSTRUCTOR.
	* decl.c (reshape_init_array_1): Likewise.

Added:
    branches/gcc-4_6-branch/gcc/testsuite/g++.dg/cpp0x/initlist48.C
Modified:
    branches/gcc-4_6-branch/gcc/cp/ChangeLog
    branches/gcc-4_6-branch/gcc/cp/call.c
    branches/gcc-4_6-branch/gcc/cp/decl.c
    branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
Comment 5 Jason Merrill 2011-04-26 23:43:35 UTC
It was fixed on the trunk by the last patch I posted with the fix for 48281, which I've now applied for 4.6.1 as well.