re PR c++/39056 ([c++0x] ICE with invalid initializer list for complex variable)
PR c++/39056 * typeck2.c (digest_init_r): Don't call process_init_constructor for COMPLEX_TYPE. * g++.dg/cpp0x/initlist13.C: New test. From-SVN: r143899
This commit is contained in:
parent
e350dbbd73
commit
a36c33ebfc
@ -1,3 +1,9 @@
|
||||
2009-02-03 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR c++/39056
|
||||
* typeck2.c (digest_init_r): Don't call process_init_constructor
|
||||
for COMPLEX_TYPE.
|
||||
|
||||
2009-02-03 Paolo Bonzini <bonzini@gnu.org>
|
||||
|
||||
PR c++/36897
|
||||
|
@ -789,7 +789,8 @@ digest_init_r (tree type, tree init, bool nested)
|
||||
}
|
||||
|
||||
/* Handle scalar types (including conversions) and references. */
|
||||
if (TREE_CODE (type) != COMPLEX_TYPE
|
||||
if ((TREE_CODE (type) != COMPLEX_TYPE
|
||||
|| BRACE_ENCLOSED_INITIALIZER_P (init))
|
||||
&& (SCALAR_TYPE_P (type) || code == REFERENCE_TYPE))
|
||||
{
|
||||
tree *exp;
|
||||
|
@ -1,3 +1,8 @@
|
||||
2009-02-03 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR c++/39056
|
||||
* g++.dg/cpp0x/initlist13.C: New test.
|
||||
|
||||
2009-02-03 Paolo Bonzini <bonzini@gnu.org>
|
||||
|
||||
PR c++/36897
|
||||
|
5
gcc/testsuite/g++.dg/cpp0x/initlist13.C
Normal file
5
gcc/testsuite/g++.dg/cpp0x/initlist13.C
Normal file
@ -0,0 +1,5 @@
|
||||
// PR c++/39056
|
||||
// { dg-do compile }
|
||||
// { dg-options "-std=gnu++0x" }
|
||||
|
||||
__complex__ int i ({0}); // { dg-error "cannot convert" }
|
Loading…
Reference in New Issue
Block a user