This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/17683] New: GCC rejects code that Comeau accepts
- From: "v dot haisman at sh dot cvut dot cz" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Sep 2004 20:44:02 -0000
- Subject: [Bug c++/17683] New: GCC rejects code that Comeau accepts
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
This compiles with Comeau but doesn't with GCC:
wilx@logout:::~/podpos> cat > maxtest.cxx
#include <algorithm>
#include <vector>
#include <numeric>
int main ()
{
std::vector<size_t> v1, v2;
size_t const mm2 = std::inner_product
(v1.begin (), v1.end (), v2.rbegin (),
static_cast<size_t>(0),
std::max<size_t>,
std::plus<size_t> ());
}
wilx@logout:::~/podpos> g++ -W -Wall -ansi -pedantic -c maxtest.cxx
maxtest.cxx: In function `int main()':
maxtest.cxx:13: error: no matching function for call to
`inner_product(__gnu_cxx::__normal_iterator<size_t*, std::vector<size_t,
std::allocator<size_t> > >, __gnu_cxx::__normal_iterator<size_t*,
std::vector<size_t, std::allocator<size_t> > >,
std::reverse_iterator<__gnu_cxx::__normal_iterator<size_t*, std::vector<size_t,
std::allocator<size_t> > > >, size_t, <unknown type>, std::plus<size_t>)'
maxtest.cxx:9: warning: unused variable 'mm2'
wilx@logout:::~/podpos> g++ -v
Reading specs from /home/4/wilx/lib/gcc/i386-unknown-freebsd4.10/4.0.0/specs
Configured with: ../srcdir/configure --disable-nls
--enable-version-specific-runtime-libs --enable-dwarf2 --with-cpu=pentium3
--with-arch=pentium3 --with-system-zlib --disable-shared --prefix=/home/4/wilx
--enable-languages=c,c++,objc --disable-sjlj-exceptions
--enable-shared=libstdc++ --enable-shared=libobjc --with-gc=zone
Thread model: posix
gcc version 4.0.0 20040926 (experimental)
--
Summary: GCC rejects code that Comeau accepts
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: v dot haisman at sh dot cvut dot cz
CC: gcc-bugs at gcc dot gnu dot org,v dot haisman at sh dot
cvut dot cz
GCC build triplet: i386-unknown-freebsd4.10
GCC host triplet: i386-unknown-freebsd4.10
GCC target triplet: i386-unknown-freebsd4.10
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17683