public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/62169] New: map iterators under _GLIBCXX_DEBUG diverge
@ 2014-08-18 12:53 terra at gnome dot org
  2014-08-18 12:56 ` [Bug libstdc++/62169] " terra at gnome dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: terra at gnome dot org @ 2014-08-18 12:53 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62169

            Bug ID: 62169
           Summary: map iterators under _GLIBCXX_DEBUG diverge
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: terra at gnome dot org

The two types
    std::map<int,int>::iterator
    std::map<const int,int>::iterator
are the same when compiled normally, but different under _GLIBCXX_DEBUG.

I actually don't know if the standard allows that, but if it does and the
difference is intentional, then the documentation ought to mention it.




welinder@sherwood:~> cat iterator.C
#include <iostream>
#include <map>

static int foo (const void *) { return 0; }
static int foo (std::map<int,int>::iterator *) { return 1; }

int
main ()
{
  std::cerr << foo (static_cast<std::map<const int,int>::iterator *> (0)) <<
std::endl;
  return 0;
}

welinder@sherwood:~> g++ iterator.C
welinder@sherwood:~> ./a.out 
1

welinder@sherwood:~> g++ -D_GLIBCXX_DEBUG iterator.C
welinder@sherwood:~> ./a.out 
0


welinder@sherwood:~> g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib64/gcc/x86_64-suse-linux/4.8/lto-wrapper
Target: x86_64-suse-linux
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info
--mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64
--enable-languages=c,c++,objc,fortran,obj-c++,java,ada
--enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.8
--enable-ssp --disable-libssp --disable-plugin
--with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE Linux'
--disable-libgcj --disable-libmudflap --with-slibdir=/lib64 --with-system-zlib
--enable-__cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch
--enable-version-specific-runtime-libs --enable-linker-build-id
--program-suffix=-4.8 --enable-linux-futex --without-system-libunwind
--with-arch-32=i586 --with-tune=generic --build=x86_64-suse-linux
Thread model: posix
gcc version 4.8.1 20130909 [gcc-4_8-branch revision 202388] (SUSE Linux) 


(Preprocessed versions coming up, just in case.)


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

end of thread, other threads:[~2014-09-19 13:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-18 12:53 [Bug libstdc++/62169] New: map iterators under _GLIBCXX_DEBUG diverge terra at gnome dot org
2014-08-18 12:56 ` [Bug libstdc++/62169] " terra at gnome dot org
2014-08-18 12:56 ` terra at gnome dot org
2014-08-18 13:01 ` terra at gnome dot org
2014-08-23 23:37 ` redi at gcc dot gnu.org
2014-08-24  0:07 ` terra at gnome dot org
2014-08-24 10:35 ` redi at gcc dot gnu.org
2014-09-19 13:20 ` redi at gcc dot gnu.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).