[Bug libstdc++/13838] New: std::bitset<>::operator |= error with -D_GLIBCXX_DEBUG

mw dot adtrap at talk21 dot com gcc-bugzilla@gcc.gnu.org
Fri Jan 23 19:22:00 GMT 2004


The appended program, when compiled with g++ -D_GLIBCXX_DEBUG=1 filename.cpp,
incorrectly prints:
1010
1100
1010

Without that flag, the output correctly is:
1010
1100
1110

This happens with g++ (GCC) 3.4.0 20040119 (prerelease).

Please, excuse if this is a duplicate. I'm under the impression that my first
attempt to report this problem didn't work.


#include <bitset>
#include <iostream>

int
main()
{
    std::bitset<4>  a, b;

    a.set(1); a.set(3);
    b.set(2); b.set(3);
    std::cout << a << '\n';
    std::cout << b << '\n';
    a |= b;
    std::cout << a << '\n';
}

-- 
           Summary: std::bitset<>::operator |= error with -D_GLIBCXX_DEBUG
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mw dot adtrap at talk21 dot com
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: i686-pc-linux-gnu


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



More information about the Gcc-bugs mailing list