* [Bug libstdc++/41510] C++0x std::complex vs. initialization lists
2009-09-30 1:47 [Bug libstdc++/41510] New: C++0x std::complex vs. initialization lists bkoz at gcc dot gnu dot org
@ 2009-09-30 1:48 ` bkoz at gcc dot gnu dot org
2010-05-22 8:07 ` [Bug libstdc++/41510] [C++0x] " paolo dot carlini at oracle dot com
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2009-09-30 1:48 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from bkoz at gcc dot gnu dot org 2009-09-30 01:48 -------
Created an attachment (id=18667)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18667&action=view)
c++0x test for std::complex
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41510
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libstdc++/41510] [C++0x] std::complex vs. initialization lists
2009-09-30 1:47 [Bug libstdc++/41510] New: C++0x std::complex vs. initialization lists bkoz at gcc dot gnu dot org
2009-09-30 1:48 ` [Bug libstdc++/41510] " bkoz at gcc dot gnu dot org
@ 2010-05-22 8:07 ` paolo dot carlini at oracle dot com
2010-05-22 15:32 ` gdr at cs dot tamu dot edu
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: paolo dot carlini at oracle dot com @ 2010-05-22 8:07 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from paolo dot carlini at oracle dot com 2010-05-22 08:07 -------
Jason, can you have a look to the errors due to the ambiguous overloading
pointed out by Benjamin? Happen for this type of copy initialization:
std::complex<value_type> z4 = {1.1, 2.2};
where value_type is either float, double or long double. I'm not at all sure we
are supposed to accept that in C++0x...
PS: as regards the patchlet to <complex> itself, I don't think is correct: in
C++0x too, as in C++03, explicit applies only to the constructors taking a
"wider" complex type to construct a "narrower" complex type, eg. constructing
complex<double> from complex<long double> is explicit, from complex<float> is
not.
--
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=41510
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libstdc++/41510] [C++0x] std::complex vs. initialization lists
2009-09-30 1:47 [Bug libstdc++/41510] New: C++0x std::complex vs. initialization lists bkoz at gcc dot gnu dot org
2009-09-30 1:48 ` [Bug libstdc++/41510] " bkoz at gcc dot gnu dot org
2010-05-22 8:07 ` [Bug libstdc++/41510] [C++0x] " paolo dot carlini at oracle dot com
@ 2010-05-22 15:32 ` gdr at cs dot tamu dot edu
2010-05-22 20:22 ` paolo dot carlini at oracle dot com
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: gdr at cs dot tamu dot edu @ 2010-05-22 15:32 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from gdr at cs dot tamu dot edu 2010-05-22 15:32 -------
Subject: Re: [C++0x] std::complex vs. initialization lists
"paolo dot carlini at oracle dot com" <gcc-bugzilla@gcc.gnu.org> writes:
| Jason, can you have a look to the errors due to the ambiguous overloading
| pointed out by Benjamin? Happen for this type of copy initialization:
|
| std::complex<value_type> z4 = {1.1, 2.2};
|
| where value_type is either float, double or long double. I'm not at all sure
we
| are supposed to accept that in C++0x...
if this ambiguity has anything to do with the constructors for
_Complex T, I think we can remove them and instead define a
free-standing function that would do the conversion with reinterpret
casts.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41510
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libstdc++/41510] [C++0x] std::complex vs. initialization lists
2009-09-30 1:47 [Bug libstdc++/41510] New: C++0x std::complex vs. initialization lists bkoz at gcc dot gnu dot org
` (2 preceding siblings ...)
2010-05-22 15:32 ` gdr at cs dot tamu dot edu
@ 2010-05-22 20:22 ` paolo dot carlini at oracle dot com
2010-05-23 2:13 ` [Bug c++/41510] " jason at gcc dot gnu dot org
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: paolo dot carlini at oracle dot com @ 2010-05-22 20:22 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from paolo dot carlini at oracle dot com 2010-05-22 20:21 -------
Hi Gaby: actually, I don't think it does, see the error messages above, which
are still up to date, as far as I can see. I will double check, anyway, and if
I notice something new I'll let you know asap. Thanks!
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41510
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/41510] [C++0x] std::complex vs. initialization lists
2009-09-30 1:47 [Bug libstdc++/41510] New: C++0x std::complex vs. initialization lists bkoz at gcc dot gnu dot org
` (3 preceding siblings ...)
2010-05-22 20:22 ` paolo dot carlini at oracle dot com
@ 2010-05-23 2:13 ` jason at gcc dot gnu dot org
2010-05-23 9:28 ` paolo dot carlini at oracle dot com
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu dot org @ 2010-05-23 2:13 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from jason at gcc dot gnu dot org 2010-05-23 02:13 -------
This seems pretty clearly a compiler bug; it only occurs in template context.
In a non-template function there is no error. That is, this works:
#include <complex>
void f()
{
std::complex<float> z4 = {1.1, 2.2};
}
but this doesn't:
#include <complex>
template <class T> void f()
{
std::complex<float> z4 = {1.1, 2.2};
}
template void f<int>();
--
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|UNCONFIRMED |ASSIGNED
Component|libstdc++ |c++
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2010-05-23 02:13:32
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41510
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/41510] [C++0x] std::complex vs. initialization lists
2009-09-30 1:47 [Bug libstdc++/41510] New: C++0x std::complex vs. initialization lists bkoz at gcc dot gnu dot org
` (4 preceding siblings ...)
2010-05-23 2:13 ` [Bug c++/41510] " jason at gcc dot gnu dot org
@ 2010-05-23 9:28 ` paolo dot carlini at oracle dot com
2010-05-24 18:38 ` jason at gcc dot gnu dot org
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: paolo dot carlini at oracle dot com @ 2010-05-23 9:28 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from paolo dot carlini at oracle dot com 2010-05-23 09:27 -------
Crazy, thanks for looking into it.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41510
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/41510] [C++0x] std::complex vs. initialization lists
2009-09-30 1:47 [Bug libstdc++/41510] New: C++0x std::complex vs. initialization lists bkoz at gcc dot gnu dot org
` (5 preceding siblings ...)
2010-05-23 9:28 ` paolo dot carlini at oracle dot com
@ 2010-05-24 18:38 ` jason at gcc dot gnu dot org
2010-05-24 20:33 ` jason at gcc dot gnu dot org
2010-05-24 20:33 ` jason at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu dot org @ 2010-05-24 18:38 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from jason at gcc dot gnu dot org 2010-05-24 18:38 -------
Subject: Bug 41510
Author: jason
Date: Mon May 24 18:38:16 2010
New Revision: 159792
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=159792
Log:
PR c++/41510
* decl.c (check_initializer): Don't wrap an init-list in a
TREE_LIST.
* init.c (build_aggr_init): Don't assume copy-initialization if
init has CONSTRUCTOR_IS_DIRECT_INIT.
* call.c (build_new_method_call): Sanity check.
Added:
trunk/gcc/testsuite/g++.dg/cpp0x/initlist35.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/call.c
trunk/gcc/cp/decl.c
trunk/gcc/cp/init.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/init/brace6.C
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41510
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/41510] [C++0x] std::complex vs. initialization lists
2009-09-30 1:47 [Bug libstdc++/41510] New: C++0x std::complex vs. initialization lists bkoz at gcc dot gnu dot org
` (6 preceding siblings ...)
2010-05-24 18:38 ` jason at gcc dot gnu dot org
@ 2010-05-24 20:33 ` jason at gcc dot gnu dot org
2010-05-24 20:33 ` jason at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu dot org @ 2010-05-24 20:33 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from jason at gcc dot gnu dot org 2010-05-24 20:33 -------
Subject: Bug 41510
Author: jason
Date: Mon May 24 20:33:06 2010
New Revision: 159796
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=159796
Log:
PR c++/41510
* decl.c (check_initializer): Don't wrap an init-list in a
TREE_LIST.
* init.c (build_aggr_init): Don't assume copy-initialization if
init has CONSTRUCTOR_IS_DIRECT_INIT.
* call.c (build_new_method_call): Sanity check.
Added:
branches/gcc-4_5-branch/gcc/testsuite/g++.dg/cpp0x/initlist35.C
Modified:
branches/gcc-4_5-branch/gcc/cp/ChangeLog
branches/gcc-4_5-branch/gcc/cp/call.c
branches/gcc-4_5-branch/gcc/cp/decl.c
branches/gcc-4_5-branch/gcc/cp/init.c
branches/gcc-4_5-branch/gcc/testsuite/ChangeLog
branches/gcc-4_5-branch/gcc/testsuite/g++.dg/init/brace6.C
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41510
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/41510] [C++0x] std::complex vs. initialization lists
2009-09-30 1:47 [Bug libstdc++/41510] New: C++0x std::complex vs. initialization lists bkoz at gcc dot gnu dot org
` (7 preceding siblings ...)
2010-05-24 20:33 ` jason at gcc dot gnu dot org
@ 2010-05-24 20:33 ` jason at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu dot org @ 2010-05-24 20:33 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from jason at gcc dot gnu dot org 2010-05-24 20:33 -------
Fixed for 4.5.1.
--
jason at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.5.1
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41510
^ permalink raw reply [flat|nested] 10+ messages in thread