This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/14252] New: Problems with count and cin (3.4 regression)


The following legal code t.C is rejected by gcc 3.4. gcc 3.3 accepts this code
without a warning.
>How-To-Repeat:
source code t.C
#include <iterator>
#include <iostream>

int main ()
{
    return std::count(std::istreambuf_iterator<char>(std::cin),
                      std::istreambuf_iterator<char>(),
                      '\n');
}

compiled by gcc 3.4
g++ -v -W -Wall t.C -save-temps
Reading specs from /usr/local/lib/gcc/i686-pc-linux-gnu/3.4.0/specs
Configured with: ../gcc/configure --enable-threads=posix
--enable-languages=c,c++,f77,objc --enable-__cxa_atexit --enable-libstdcxx-debug
Thread model: posix
gcc version 3.4.0 20040221 (prerelease)
 /usr/local/libexec/gcc/i686-pc-linux-gnu/3.4.0/cc1plus -E -quiet -v
-D_GNU_SOURCE t.C -mtune=pentiumpro -W -Wall -o t.ii
ignoring nonexistent directory "NONE/include"
ignoring nonexistent directory
"/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.0/../../../../i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/lib/gcc/i686-pc-linux-gnu/3.4.0/../../../../include/c++/3.4.0
 /usr/local/lib/gcc/i686-pc-linux-gnu/3.4.0/../../../../include/c++/3.4.0/i686-pc-linux-gnu
 /usr/local/lib/gcc/i686-pc-linux-gnu/3.4.0/../../../../include/c++/3.4.0/backward
 /usr/local/include
 /usr/local/lib/gcc/i686-pc-linux-gnu/3.4.0/include
 /usr/include
End of search list.
 /usr/local/libexec/gcc/i686-pc-linux-gnu/3.4.0/cc1plus -fpreprocessed t.ii
-quiet -dumpbase t.C -mtune=pentiumpro -auxbase t -W -Wall -version -o t.s
GNU C++ version 3.4.0 20040221 (prerelease) (i686-pc-linux-gnu)
	compiled by GNU C version 3.4.0 20040221 (prerelease).
GGC heuristics: --param ggc-min-expand=64 --param ggc-min-heapsize=64274
/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.0/../../../../include/c++/3.4.0/bits/stl_algo.h:
In function `typename std::iterator_traits<_Iterator>::difference_type
std::count(_InputIterator, _InputIterator, const _Tp&) [with _InputIterator =
std::istreambuf_iterator<char, std::char_traits<char> >, _Tp = char]':
t.C:8:   instantiated from here
/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.0/../../../../include/c++/3.4.0/bits/stl_algo.h:405:
error: no match for 'operator++' in '++__n'

compiled by gcc 3.3
/usr/bin/g++ -v -W -Wall t.C -save-temps
Reading specs from /usr/lib/gcc-lib/i586-suse-linux/3.3.1/specs
Configured with: ../configure --enable-threads=posix --prefix=/usr
--with-local-prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man
--libdir=/usr/lib --enable-languages=c,c++,f77,objc,java,ada --disable-checking
--enable-libgcj --with-gxx-include-dir=/usr/include/g++ --with-slibdir=/lib
--with-system-zlib --enable-shared --enable-__cxa_atexit i586-suse-linux
Thread model: posix
gcc version 3.3.1 (SuSE Linux)
 /usr/lib/gcc-lib/i586-suse-linux/3.3.1/cc1plus -E -D__GNUG__=3 -quiet -v
-D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=1 -D_GNU_SOURCE t.C -W
-Wall t.ii
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/g++
 /usr/include/g++/i586-suse-linux
 /usr/include/g++/backward
 /usr/local/include
 /usr/lib/gcc-lib/i586-suse-linux/3.3.1/include
 /usr/i586-suse-linux/include
 /usr/include
End of search list.
 /usr/lib/gcc-lib/i586-suse-linux/3.3.1/cc1plus -fpreprocessed t.ii -quiet
-dumpbase t.C -auxbase t -W -Wall -version -o t.s
GNU C++ version 3.3.1 (SuSE Linux) (i586-suse-linux)
	compiled by GNU C version 3.3.1 (SuSE Linux).
GGC heuristics: --param ggc-min-expand=64 --param ggc-min-heapsize=64274
 /usr/lib/gcc-lib/i586-suse-linux/3.3.1/../../../../i586-suse-linux/bin/as -V
-Qy -o t.o t.s
GNU assembler version 2.14.90.0.5 (i586-suse-linux) using BFD version
2.14.90.0.5 20030722 (SuSE Linux)
 /usr/lib/gcc-lib/i586-suse-linux/3.3.1/collect2 --eh-frame-hdr -m elf_i386
-dynamic-linker /lib/ld-linux.so.2
/usr/lib/gcc-lib/i586-suse-linux/3.3.1/../../../crt1.o
/usr/lib/gcc-lib/i586-suse-linux/3.3.1/../../../crti.o
/usr/lib/gcc-lib/i586-suse-linux/3.3.1/crtbegin.o
-L/usr/lib/gcc-lib/i586-suse-linux/3.3.1
-L/usr/lib/gcc-lib/i586-suse-linux/3.3.1/../../../../i586-suse-linux/lib
-L/usr/lib/gcc-lib/i586-suse-linux/3.3.1/../../.. t.o -lstdc++ -lm -lgcc_s -lgcc
-lc -lgcc_s -lgcc /usr/lib/gcc-lib/i586-suse-linux/3.3.1/crtend.o
/usr/lib/gcc-lib/i586-suse-linux/3.3.1/../../../crtn.o


The systen does not allow me to attach the prprocessed source file because of
its size. If this is a problem I can profide the file upon request.

-- 
           Summary: Problems with count and cin (3.4 regression)
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P1
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: schmid at snake dot iap dot physik dot tu-darmstadt dot
                    de
                CC: gcc-bugs at gcc dot gnu dot org
 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=14252


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]