public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/38244]  New: bitset initialization from 0 rejected.
@ 2008-11-24  3:54 cgd at google dot com
  2008-11-24  3:55 ` [Bug libstdc++/38244] " cgd at google dot com
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: cgd at google dot com @ 2008-11-24  3:54 UTC (permalink / raw)
  To: gcc-bugs

g++ compiled as of yesterday afternoon:

Using built-in specs.
Target: i686-linux
Configured with: ../trunk/configure --enable-languages=c,c++ --build=i686-linux
--host=i686-linux --target=i686-linux
--prefix=/g/users/cgd/proj/gcc-trunk/bld/../inst
Thread model: posix
gcc version 4.4.0 20081123 (experimental) (GCC) 

rejects the AFAICT-valid code:

#include <bitset>

class C0 {
 public:
  C0() : b(0) { }  // FAILS.
 private:
  std::bitset<1> b;
};

class C1 {
 public:
  C1() : b(1) { }  // OK!
 private:
  std::bitset<1> b;
};

void func() {
  C0 val0;
  C1 val1;
}

(in particular, the 'C0' initialization) with the error:

test.cc: In constructor 'C0::C0()':
test.cc:5: error: call of overloaded 'bitset(int)' is ambiguous
/g/users/cgd/proj/gcc-trunk/inst/bin/../lib/gcc/i686-linux/4.4.0/../../../../include/c++/4.4.0/bitset:808:
note: candidates are: std::bitset<_Nb>::bitset(const char*, char, char) [with
unsigned int _Nb = 1u]
/g/users/cgd/proj/gcc-trunk/inst/bin/../lib/gcc/i686-linux/4.4.0/../../../../include/c++/4.4.0/bitset:744:
note:                 std::bitset<_Nb>::bitset(long unsigned int) [with
unsigned int _Nb = 1u]
/g/users/cgd/proj/gcc-trunk/inst/bin/../lib/gcc/i686-linux/4.4.0/../../../../include/c++/4.4.0/bitset:652:
note:                 std::bitset<1u>::bitset(const std::bitset<1u>&)

I'm not completely sure what's going on here, but I'm thinking it's related to
the fact that the 'char*' ctor actually has two default arguments, and 0 is
convertible to a pointer.

This code is accepted by GCC 4.3.2 and the Comeau test drive.


-- 
           Summary: bitset initialization from 0 rejected.
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: cgd at google dot com
 GCC build triplet: i686-linux
  GCC host triplet: i686-linux
GCC target triplet: i686-linux


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


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

* [Bug libstdc++/38244] bitset initialization from 0 rejected.
  2008-11-24  3:54 [Bug libstdc++/38244] New: bitset initialization from 0 rejected cgd at google dot com
@ 2008-11-24  3:55 ` cgd at google dot com
  2008-11-24 10:09 ` rguenth at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: cgd at google dot com @ 2008-11-24  3:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from cgd at google dot com  2008-11-24 03:54 -------
Created an attachment (id=16754)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16754&action=view)
preprocessed source from test case in bug report.


-- 


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


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

* [Bug libstdc++/38244] bitset initialization from 0 rejected.
  2008-11-24  3:54 [Bug libstdc++/38244] New: bitset initialization from 0 rejected cgd at google dot com
  2008-11-24  3:55 ` [Bug libstdc++/38244] " cgd at google dot com
@ 2008-11-24 10:09 ` rguenth at gcc dot gnu dot org
  2008-11-24 10:22 ` paolo dot carlini at oracle dot com
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-11-24 10:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rguenth at gcc dot gnu dot org  2008-11-24 10:08 -------
Confirmed.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |rejects-valid
   Last reconfirmed|0000-00-00 00:00:00         |2008-11-24 10:08:16
               date|                            |


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


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

* [Bug libstdc++/38244] bitset initialization from 0 rejected.
  2008-11-24  3:54 [Bug libstdc++/38244] New: bitset initialization from 0 rejected cgd at google dot com
  2008-11-24  3:55 ` [Bug libstdc++/38244] " cgd at google dot com
  2008-11-24 10:09 ` rguenth at gcc dot gnu dot org
@ 2008-11-24 10:22 ` paolo dot carlini at oracle dot com
  2008-11-24 10:52 ` [Bug libstdc++/38244] [4.4 Regression] " paolo dot carlini at oracle dot com
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: paolo dot carlini at oracle dot com @ 2008-11-24 10:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from paolo dot carlini at oracle dot com  2008-11-24 10:21 -------
This is essentially a defect in DR 778:

  http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#778

I'll see what we can do for now.


-- 

paolo dot carlini at oracle dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |paolo dot carlini at oracle
                   |dot org                     |dot com
             Status|NEW                         |ASSIGNED


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


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

* [Bug libstdc++/38244] [4.4 Regression] bitset initialization from 0 rejected.
  2008-11-24  3:54 [Bug libstdc++/38244] New: bitset initialization from 0 rejected cgd at google dot com
                   ` (2 preceding siblings ...)
  2008-11-24 10:22 ` paolo dot carlini at oracle dot com
@ 2008-11-24 10:52 ` paolo dot carlini at oracle dot com
  2008-11-24 11:16 ` paolo at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: paolo dot carlini at oracle dot com @ 2008-11-24 10:52 UTC (permalink / raw)
  To: gcc-bugs



-- 

paolo dot carlini at oracle dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|bitset initialization from 0|[4.4 Regression] bitset
                   |rejected.                   |initialization from 0
                   |                            |rejected.
   Target Milestone|---                         |4.4.0


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


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

* [Bug libstdc++/38244] [4.4 Regression] bitset initialization from 0 rejected.
  2008-11-24  3:54 [Bug libstdc++/38244] New: bitset initialization from 0 rejected cgd at google dot com
                   ` (4 preceding siblings ...)
  2008-11-24 11:16 ` paolo at gcc dot gnu dot org
@ 2008-11-24 11:16 ` paolo dot carlini at oracle dot com
  2008-11-24 11:22 ` paolo at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: paolo dot carlini at oracle dot com @ 2008-11-24 11:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from paolo dot carlini at oracle dot com  2008-11-24 11:15 -------
Fixed.


-- 

paolo dot carlini at oracle dot com changed:

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


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


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

* [Bug libstdc++/38244] [4.4 Regression] bitset initialization from 0 rejected.
  2008-11-24  3:54 [Bug libstdc++/38244] New: bitset initialization from 0 rejected cgd at google dot com
                   ` (3 preceding siblings ...)
  2008-11-24 10:52 ` [Bug libstdc++/38244] [4.4 Regression] " paolo dot carlini at oracle dot com
@ 2008-11-24 11:16 ` paolo at gcc dot gnu dot org
  2008-11-24 11:16 ` paolo dot carlini at oracle dot com
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: paolo at gcc dot gnu dot org @ 2008-11-24 11:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from paolo at gcc dot gnu dot org  2008-11-24 11:14 -------
Subject: Bug 38244

Author: paolo
Date: Mon Nov 24 11:13:44 2008
New Revision: 142152

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=142152
Log:
2008-11-24  Paolo Carlini  <paolo.carlini@oracle.com>

        PR libstdc++/38244
        * include/std/bitset (bitset<>::bitset(const char*, char, char)):
        Remove, do not implement DR 778.
        * doc/xml/manual/intro.xml: Remove entry for DR 778.
        * testsuite/23_containers/bitset/cons/2.cc: Remove.
        * testsuite/23_containers/bitset/cons/dr396.cc: Tweak.
        * testsuite/23_containers/bitset/cons/38244.cc: Add.

Added:
    trunk/libstdc++-v3/testsuite/23_containers/bitset/cons/38244.cc
Removed:
    trunk/libstdc++-v3/testsuite/23_containers/bitset/cons/2.cc
Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/doc/xml/manual/intro.xml
    trunk/libstdc++-v3/include/std/bitset
    trunk/libstdc++-v3/testsuite/23_containers/bitset/cons/dr396.cc


-- 


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


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

* [Bug libstdc++/38244] [4.4 Regression] bitset initialization from 0 rejected.
  2008-11-24  3:54 [Bug libstdc++/38244] New: bitset initialization from 0 rejected cgd at google dot com
                   ` (5 preceding siblings ...)
  2008-11-24 11:16 ` paolo dot carlini at oracle dot com
@ 2008-11-24 11:22 ` paolo at gcc dot gnu dot org
  2008-11-24 20:56 ` cgd at google dot com
  2008-12-01 18:32 ` cgd at google dot com
  8 siblings, 0 replies; 10+ messages in thread
From: paolo at gcc dot gnu dot org @ 2008-11-24 11:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from paolo at gcc dot gnu dot org  2008-11-24 11:21 -------
Subject: Bug 38244

Author: paolo
Date: Mon Nov 24 11:19:39 2008
New Revision: 142153

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=142153
Log:
2008-11-24  Paolo Carlini  <paolo.carlini@oracle.com>

        PR libstdc++/38244 (cont, debug bits)
        * include/debug/bitset (bitset<>::bitset(const char*, char, char)):
        Remove, do not implement DR 778.


Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/include/debug/bitset


-- 


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


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

* [Bug libstdc++/38244] [4.4 Regression] bitset initialization from 0 rejected.
  2008-11-24  3:54 [Bug libstdc++/38244] New: bitset initialization from 0 rejected cgd at google dot com
                   ` (6 preceding siblings ...)
  2008-11-24 11:22 ` paolo at gcc dot gnu dot org
@ 2008-11-24 20:56 ` cgd at google dot com
  2008-12-01 18:32 ` cgd at google dot com
  8 siblings, 0 replies; 10+ messages in thread
From: cgd at google dot com @ 2008-11-24 20:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from cgd at google dot com  2008-11-24 20:55 -------
Would it make sense to add a this test code as a test case?



-- 


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


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

* [Bug libstdc++/38244] [4.4 Regression] bitset initialization from 0 rejected.
  2008-11-24  3:54 [Bug libstdc++/38244] New: bitset initialization from 0 rejected cgd at google dot com
                   ` (7 preceding siblings ...)
  2008-11-24 20:56 ` cgd at google dot com
@ 2008-12-01 18:32 ` cgd at google dot com
  8 siblings, 0 replies; 10+ messages in thread
From: cgd at google dot com @ 2008-12-01 18:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from cgd at google dot com  2008-12-01 18:30 -------
(re: my last comment on 11/24: I see you added the test case in the original
commit!  Sorry, didn't notice that!  Thanks much for resolving the issue.)


-- 


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


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

end of thread, other threads:[~2008-12-01 18:32 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-24  3:54 [Bug libstdc++/38244] New: bitset initialization from 0 rejected cgd at google dot com
2008-11-24  3:55 ` [Bug libstdc++/38244] " cgd at google dot com
2008-11-24 10:09 ` rguenth at gcc dot gnu dot org
2008-11-24 10:22 ` paolo dot carlini at oracle dot com
2008-11-24 10:52 ` [Bug libstdc++/38244] [4.4 Regression] " paolo dot carlini at oracle dot com
2008-11-24 11:16 ` paolo at gcc dot gnu dot org
2008-11-24 11:16 ` paolo dot carlini at oracle dot com
2008-11-24 11:22 ` paolo at gcc dot gnu dot org
2008-11-24 20:56 ` cgd at google dot com
2008-12-01 18:32 ` cgd at google dot com

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