[Bug c++/39056] [4.4 regression] [c++0x] ICE with invalid initializer list for complex variable
jakub at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Mon Feb 2 11:18:00 GMT 2009
------- Comment #1 from jakub at gcc dot gnu dot org 2009-02-02 11:18 -------
I think this depends on whether we want as an exception allow this or not.
If not, e.g.:
--- typeck2.c.jj22009-01-13 18:32:14.000000000 +0100
+++ typeck2.c2009-02-02 12:15:58.000000000 +0100
@@ -789,7 +789,8 @@ digest_init_r (tree type, tree init, boo
}
/* 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;
gets rid of the ICE, instead it will reject it with:
pr39056.C:1: error: cannot convert '<brace-enclosed initializer list>' to 'int
__complex__' in initialization
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39056
More information about the Gcc-bugs
mailing list