[Bug c++/30209] C++ front-end rejects valid compound literal (with complex types)

gdr at cs dot tamu dot edu gcc-bugzilla@gcc.gnu.org
Thu Dec 14 16:30:00 GMT 2006



------- Comment #2 from gdr at cs dot tamu dot edu  2006-12-14 16:30 -------
Subject: Re:  C++ front-end rejects valid compound literal (with complex types)

"rguenth at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:

| Even
| 
| _Complex double foo (double x)
| {
|   return (_Complex double) x;
| }
| 
| or
| 
| _Complex double foo (double x)
| {
|   return x;
| }
| 
| does not work.  But
| 
| _Complex double foo (double x)
| {
|   return x + 1.i;
| }
| 
| does.

I believe there was a long thread about this for the C++ front-end.
The issue is that _Complex is a new fundamental type, ttherefore needs
elaboration about ordering conversion rules, including overload
resolution.  The issue was coumponded by the fact that C++ has a class
template complex with slightly different rules.
I don't remember what the conclusion was.

-- Gaby


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30209



More information about the Gcc-bugs mailing list