diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 39a5eb855a2..c84de888aed 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2009-02-03 Jakub Jelinek + + PR c++/39056 + * typeck2.c (digest_init_r): Don't call process_init_constructor + for COMPLEX_TYPE. + 2009-02-03 Paolo Bonzini PR c++/36897 diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c index a19a99920b6..526f780cddf 100644 --- a/gcc/cp/typeck2.c +++ b/gcc/cp/typeck2.c @@ -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; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ba77486a3e7..128a7620803 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-02-03 Jakub Jelinek + + PR c++/39056 + * g++.dg/cpp0x/initlist13.C: New test. + 2009-02-03 Paolo Bonzini PR c++/36897 diff --git a/gcc/testsuite/g++.dg/cpp0x/initlist13.C b/gcc/testsuite/g++.dg/cpp0x/initlist13.C new file mode 100644 index 00000000000..98af92bca53 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/initlist13.C @@ -0,0 +1,5 @@ +// PR c++/39056 +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +__complex__ int i ({0}); // { dg-error "cannot convert" }