* [Bug c++/44045] initialization of array of shared_ptr's with initializer list causes compiler segfault
2010-05-08 23:06 [Bug libstdc++/44045] New: " lynczu at gmail dot com
@ 2010-05-08 23:15 ` paolo dot carlini at oracle dot com
2010-05-09 9:58 ` lynczu at gmail dot com
` (9 subsequent siblings)
10 siblings, 0 replies; 13+ messages in thread
From: paolo dot carlini at oracle dot com @ 2010-05-08 23:15 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from paolo dot carlini at oracle dot com 2010-05-08 23:15 -------
If it's a segmentation fault, isn't a library issue, that for sure.
--
paolo dot carlini at oracle dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|libstdc++ |c++
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44045
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/44045] initialization of array of shared_ptr's with initializer list causes compiler segfault
2010-05-08 23:06 [Bug libstdc++/44045] New: " lynczu at gmail dot com
2010-05-08 23:15 ` [Bug c++/44045] " paolo dot carlini at oracle dot com
@ 2010-05-09 9:58 ` lynczu at gmail dot com
2010-05-09 16:24 ` dougsemler at gmail dot com
` (8 subsequent siblings)
10 siblings, 0 replies; 13+ messages in thread
From: lynczu at gmail dot com @ 2010-05-09 9:58 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from lynczu at gmail dot com 2010-05-09 09:58 -------
reopened then
--
lynczu at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Component|libstdc++ |c++
Resolution|INVALID |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44045
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/44045] initialization of array of shared_ptr's with initializer list causes compiler segfault
2010-05-08 23:06 [Bug libstdc++/44045] New: " lynczu at gmail dot com
2010-05-08 23:15 ` [Bug c++/44045] " paolo dot carlini at oracle dot com
2010-05-09 9:58 ` lynczu at gmail dot com
@ 2010-05-09 16:24 ` dougsemler at gmail dot com
2010-05-09 16:47 ` paolo dot carlini at oracle dot com
` (7 subsequent siblings)
10 siblings, 0 replies; 13+ messages in thread
From: dougsemler at gmail dot com @ 2010-05-09 16:24 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from dougsemler at gmail dot com 2010-05-09 16:24 -------
Reduced test case:
# 1 "gcc_bug2.cc"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "gcc_bug2.cc"
struct base
{
virtual ~base() { }
};
int main()
{
base ptr_array[1];
ptr_array = { base() };
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44045
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/44045] initialization of array of shared_ptr's with initializer list causes compiler segfault
2010-05-08 23:06 [Bug libstdc++/44045] New: " lynczu at gmail dot com
` (2 preceding siblings ...)
2010-05-09 16:24 ` dougsemler at gmail dot com
@ 2010-05-09 16:47 ` paolo dot carlini at oracle dot com
2010-05-09 16:52 ` paolo dot carlini at oracle dot com
` (6 subsequent siblings)
10 siblings, 0 replies; 13+ messages in thread
From: paolo dot carlini at oracle dot com @ 2010-05-09 16:47 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from paolo dot carlini at oracle dot com 2010-05-09 16:47 -------
Many thanks, this will help the debugging a lot. CC-ing Jason...
--
paolo dot carlini at oracle dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jason at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44045
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/44045] initialization of array of shared_ptr's with initializer list causes compiler segfault
2010-05-08 23:06 [Bug libstdc++/44045] New: " lynczu at gmail dot com
` (3 preceding siblings ...)
2010-05-09 16:47 ` paolo dot carlini at oracle dot com
@ 2010-05-09 16:52 ` paolo dot carlini at oracle dot com
2010-05-09 20:36 ` jason at gcc dot gnu dot org
` (5 subsequent siblings)
10 siblings, 0 replies; 13+ messages in thread
From: paolo dot carlini at oracle dot com @ 2010-05-09 16:52 UTC (permalink / raw)
To: gcc-bugs
--
paolo dot carlini at oracle dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2010-05-09 16:51:56
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44045
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/44045] initialization of array of shared_ptr's with initializer list causes compiler segfault
2010-05-08 23:06 [Bug libstdc++/44045] New: " lynczu at gmail dot com
` (4 preceding siblings ...)
2010-05-09 16:52 ` paolo dot carlini at oracle dot com
@ 2010-05-09 20:36 ` jason at gcc dot gnu dot org
2010-05-10 15:30 ` jason at gcc dot gnu dot org
` (4 subsequent siblings)
10 siblings, 0 replies; 13+ messages in thread
From: jason at gcc dot gnu dot org @ 2010-05-09 20:36 UTC (permalink / raw)
To: gcc-bugs
--
jason at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |jason at gcc dot gnu dot org
|dot org |
Status|NEW |ASSIGNED
Last reconfirmed|2010-05-09 16:51:56 |2010-05-09 20:36:10
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44045
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/44045] initialization of array of shared_ptr's with initializer list causes compiler segfault
2010-05-08 23:06 [Bug libstdc++/44045] New: " lynczu at gmail dot com
` (5 preceding siblings ...)
2010-05-09 20:36 ` jason at gcc dot gnu dot org
@ 2010-05-10 15:30 ` jason at gcc dot gnu dot org
2010-05-10 17:18 ` dougsemler at gmail dot com
` (3 subsequent siblings)
10 siblings, 0 replies; 13+ messages in thread
From: jason at gcc dot gnu dot org @ 2010-05-10 15:30 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from jason at gcc dot gnu dot org 2010-05-10 15:30 -------
The testcase is invalid; 5.17 doesn't allow assignment to an array from an
initializer list (although I'm not sure why not). But certainly we should give
an error rather than crash.
--
jason at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |ice-on-invalid-code
Target Milestone|--- |4.6.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44045
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/44045] initialization of array of shared_ptr's with initializer list causes compiler segfault
2010-05-08 23:06 [Bug libstdc++/44045] New: " lynczu at gmail dot com
` (6 preceding siblings ...)
2010-05-10 15:30 ` jason at gcc dot gnu dot org
@ 2010-05-10 17:18 ` dougsemler at gmail dot com
2010-05-10 17:33 ` redi at gcc dot gnu dot org
` (2 subsequent siblings)
10 siblings, 0 replies; 13+ messages in thread
From: dougsemler at gmail dot com @ 2010-05-10 17:18 UTC (permalink / raw)
To: gcc-bugs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 564 bytes --]
------- Comment #10 from dougsemler at gmail dot com 2010-05-10 17:18 -------
Well, is it really invalid code with -std=c++0x?
The virutal destructor seems to be causing the issue.
With gcc 4.4.3 (after changing virtual ~base() to virtual void func()):
$ g++ gcc_bug.cc
gcc_bug.cc: In function âint main()â:
gcc_bug.cc:9: warning: extended initializer lists only available with
-std=c++0x or -std=gnu++0x
$ g++ gcc_bug.cc -std=c++0x
$
So you can see that g++ sees this as valid code.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44045
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/44045] initialization of array of shared_ptr's with initializer list causes compiler segfault
2010-05-08 23:06 [Bug libstdc++/44045] New: " lynczu at gmail dot com
` (7 preceding siblings ...)
2010-05-10 17:18 ` dougsemler at gmail dot com
@ 2010-05-10 17:33 ` redi at gcc dot gnu dot org
2010-05-10 18:38 ` jason at gcc dot gnu dot org
2010-05-10 18:41 ` jason at gcc dot gnu dot org
10 siblings, 0 replies; 13+ messages in thread
From: redi at gcc dot gnu dot org @ 2010-05-10 17:33 UTC (permalink / raw)
To: gcc-bugs
------- Comment #11 from redi at gcc dot gnu dot org 2010-05-10 17:32 -------
(In reply to comment #10)
> So you can see that g++ sees this as valid code.
I think that's a bug too
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44045
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/44045] initialization of array of shared_ptr's with initializer list causes compiler segfault
2010-05-08 23:06 [Bug libstdc++/44045] New: " lynczu at gmail dot com
` (8 preceding siblings ...)
2010-05-10 17:33 ` redi at gcc dot gnu dot org
@ 2010-05-10 18:38 ` jason at gcc dot gnu dot org
2010-05-10 18:41 ` jason at gcc dot gnu dot org
10 siblings, 0 replies; 13+ messages in thread
From: jason at gcc dot gnu dot org @ 2010-05-10 18:38 UTC (permalink / raw)
To: gcc-bugs
------- Comment #12 from jason at gcc dot gnu dot org 2010-05-10 18:38 -------
Subject: Bug 44045
Author: jason
Date: Mon May 10 18:37:56 2010
New Revision: 159243
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=159243
Log:
PR c++/44045
* typeck.c (cp_build_modify_expr): Complain about assignment to
array from init list.
Added:
trunk/gcc/testsuite/g++.dg/cpp0x/initlist33.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/typeck.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/cpp0x/initlist26.C
trunk/gcc/testsuite/g++.dg/cpp0x/initlist28.C
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44045
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/44045] initialization of array of shared_ptr's with initializer list causes compiler segfault
2010-05-08 23:06 [Bug libstdc++/44045] New: " lynczu at gmail dot com
` (9 preceding siblings ...)
2010-05-10 18:38 ` jason at gcc dot gnu dot org
@ 2010-05-10 18:41 ` jason at gcc dot gnu dot org
10 siblings, 0 replies; 13+ messages in thread
From: jason at gcc dot gnu dot org @ 2010-05-10 18:41 UTC (permalink / raw)
To: gcc-bugs
------- Comment #13 from jason at gcc dot gnu dot org 2010-05-10 18:40 -------
Fixed for 4.6.
--
jason at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44045
^ permalink raw reply [flat|nested] 13+ messages in thread