public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/37740]  New: [C++0x] "foo f{...}" form compiles, but "new foo{...}" one doesn't
@ 2008-10-05 23:53 florian dot goujeon at wanadoo dot fr
  2008-10-06  8:38 ` [Bug c++/37740] " paolo dot carlini at oracle dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: florian dot goujeon at wanadoo dot fr @ 2008-10-05 23:53 UTC (permalink / raw)
  To: gcc-bugs

With the following piece of code:

==============================
struct integer
{
    int i;
};

struct foo1
{
    double d;
    int i;
};

struct foo2
{
    double d;
    integer i;
};

int main(int argc, char **argv)
{
    int i1 = 0;
    integer i2{0};

    foo1 f1{3.2, i1}; //ok
    new foo1{3.2, i1}; //ok

    foo2 f2{3.2, i2}; //ok
    new foo2{3.2, i2}; //error, why?

    return 0;
}
==============================

GCC 4.4 svn (4.4.0 20081005) can't compile "new foo2{...}" line:

==============================
$ g++ -std=c++0x main.cpp
main.cpp: In function 'int main(int, char**)':
main.cpp:53: error: could not convert
'{3.20000000000000017763568394002504646778106689453e+0, i2}' to 'foo2'
==============================

though the other lines are OK.

I didn't see anything about a difference between the two forms in the standard,
so I guess it is a GCC bug.


$ g++ -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc/configure --enable-languages='c c++' --disable-nls :
(reconfigured) ../gcc/configure --enable-languages='c c++' : (reconfigured)
../gcc/configure --enable-languages='c c++' --enable-shared --disable-static
--disable-nls
Thread model: posix
gcc version 4.4.0 20081005 (experimental) (GCC)


-- 
           Summary: [C++0x] "foo f{...}" form compiles, but "new foo{...}"
                    one doesn't
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: florian dot goujeon at wanadoo dot fr
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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

* [Bug c++/37740] [C++0x] "foo f{...}" form compiles, but "new foo{...}" one doesn't
  2008-10-05 23:53 [Bug c++/37740] New: [C++0x] "foo f{...}" form compiles, but "new foo{...}" one doesn't florian dot goujeon at wanadoo dot fr
@ 2008-10-06  8:38 ` paolo dot carlini at oracle dot com
  2008-11-14 16:25 ` jason at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: paolo dot carlini at oracle dot com @ 2008-10-06  8:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from paolo dot carlini at oracle dot com  2008-10-06 08:37 -------
Let's CC Jason...


-- 

paolo dot carlini at oracle dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu dot org


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


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

* [Bug c++/37740] [C++0x] "foo f{...}" form compiles, but "new foo{...}" one doesn't
  2008-10-05 23:53 [Bug c++/37740] New: [C++0x] "foo f{...}" form compiles, but "new foo{...}" one doesn't florian dot goujeon at wanadoo dot fr
  2008-10-06  8:38 ` [Bug c++/37740] " paolo dot carlini at oracle dot com
@ 2008-11-14 16:25 ` jason at gcc dot gnu dot org
  2008-11-14 20:53 ` jason at gcc dot gnu dot org
  2008-11-14 22:23 ` jason at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: jason at gcc dot gnu dot org @ 2008-11-14 16:25 UTC (permalink / raw)
  To: gcc-bugs



-- 

jason at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jason at gcc dot gnu dot org
                   |dot org                     |
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-11-14 16:23:44
               date|                            |


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


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

* [Bug c++/37740] [C++0x] "foo f{...}" form compiles, but "new foo{...}" one doesn't
  2008-10-05 23:53 [Bug c++/37740] New: [C++0x] "foo f{...}" form compiles, but "new foo{...}" one doesn't florian dot goujeon at wanadoo dot fr
  2008-10-06  8:38 ` [Bug c++/37740] " paolo dot carlini at oracle dot com
  2008-11-14 16:25 ` jason at gcc dot gnu dot org
@ 2008-11-14 20:53 ` jason at gcc dot gnu dot org
  2008-11-14 22:23 ` jason at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: jason at gcc dot gnu dot org @ 2008-11-14 20:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jason at gcc dot gnu dot org  2008-11-14 20:52 -------
Subject: Bug 37740

Author: jason
Date: Fri Nov 14 20:50:59 2008
New Revision: 141865

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=141865
Log:
        PR c++/37740
        * call.c (build_aggr_conv): Increment i.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/initlist8.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/call.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/37740] [C++0x] "foo f{...}" form compiles, but "new foo{...}" one doesn't
  2008-10-05 23:53 [Bug c++/37740] New: [C++0x] "foo f{...}" form compiles, but "new foo{...}" one doesn't florian dot goujeon at wanadoo dot fr
                   ` (2 preceding siblings ...)
  2008-11-14 20:53 ` jason at gcc dot gnu dot org
@ 2008-11-14 22:23 ` jason at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: jason at gcc dot gnu dot org @ 2008-11-14 22:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jason at gcc dot gnu dot org  2008-11-14 22:22 -------
Fixed.


-- 

jason at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2008-11-14 22:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-05 23:53 [Bug c++/37740] New: [C++0x] "foo f{...}" form compiles, but "new foo{...}" one doesn't florian dot goujeon at wanadoo dot fr
2008-10-06  8:38 ` [Bug c++/37740] " paolo dot carlini at oracle dot com
2008-11-14 16:25 ` jason at gcc dot gnu dot org
2008-11-14 20:53 ` jason at gcc dot gnu dot org
2008-11-14 22:23 ` jason 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).