public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/30209]  New: C++ front-end rejects valid compound literal (with complex types)
@ 2006-12-14  5:21 pinskia at gcc dot gnu dot org
  2006-12-14 11:21 ` [Bug c++/30209] " rguenth at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-12-14  5:21 UTC (permalink / raw)
  To: gcc-bugs

Testcase:
_Complex float f(float x, float y)
{
  _Complex float a = (_Complex float){x};
  return a;
}


-- 
           Summary: C++ front-end rejects valid compound literal (with
                    complex types)
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/30209] C++ front-end rejects valid compound literal (with complex types)
  2006-12-14  5:21 [Bug c++/30209] New: C++ front-end rejects valid compound literal (with complex types) pinskia at gcc dot gnu dot org
@ 2006-12-14 11:21 ` rguenth at gcc dot gnu dot org
  2006-12-14 16:30 ` gdr at cs dot tamu dot edu
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-12-14 11:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rguenth at gcc dot gnu dot org  2006-12-14 11:21 -------
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.


-- 


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/30209] C++ front-end rejects valid compound literal (with complex types)
  2006-12-14  5:21 [Bug c++/30209] New: C++ front-end rejects valid compound literal (with complex types) pinskia at gcc dot gnu dot org
  2006-12-14 11:21 ` [Bug c++/30209] " rguenth at gcc dot gnu dot org
@ 2006-12-14 16:30 ` gdr at cs dot tamu dot edu
  2008-01-25 20:20 ` jason at gcc dot gnu dot org
  2008-01-26 14:29 ` reichelt at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: gdr at cs dot tamu dot edu @ 2006-12-14 16:30 UTC (permalink / raw)
  To: gcc-bugs



------- 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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/30209] C++ front-end rejects valid compound literal (with complex types)
  2006-12-14  5:21 [Bug c++/30209] New: C++ front-end rejects valid compound literal (with complex types) pinskia at gcc dot gnu dot org
  2006-12-14 11:21 ` [Bug c++/30209] " rguenth at gcc dot gnu dot org
  2006-12-14 16:30 ` gdr at cs dot tamu dot edu
@ 2008-01-25 20:20 ` jason at gcc dot gnu dot org
  2008-01-26 14:29 ` reichelt at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: jason at gcc dot gnu dot org @ 2008-01-25 20:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jason at gcc dot gnu dot org  2008-01-25 19:52 -------
Fixed by the patch for bug 31780.


-- 

jason at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/30209] C++ front-end rejects valid compound literal (with complex types)
  2006-12-14  5:21 [Bug c++/30209] New: C++ front-end rejects valid compound literal (with complex types) pinskia at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2008-01-25 20:20 ` jason at gcc dot gnu dot org
@ 2008-01-26 14:29 ` reichelt at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2008-01-26 14:29 UTC (permalink / raw)
  To: gcc-bugs



-- 

reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.3.0


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-01-26 13:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-14  5:21 [Bug c++/30209] New: C++ front-end rejects valid compound literal (with complex types) pinskia at gcc dot gnu dot org
2006-12-14 11:21 ` [Bug c++/30209] " rguenth at gcc dot gnu dot org
2006-12-14 16:30 ` gdr at cs dot tamu dot edu
2008-01-25 20:20 ` jason at gcc dot gnu dot org
2008-01-26 14:29 ` reichelt at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).