This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/2295
- To: nobody at gcc dot gnu dot org
- Subject: Re: c++/2295
- From: bkoz at gcc dot gnu dot org
- Date: 19 Mar 2001 21:16:00 -0000
- Cc: gcc-prs at gcc dot gnu dot org,
- Reply-To: bkoz at gcc dot gnu dot org
The following reply was made to PR c++/2295; it has been noted by GNATS.
From: bkoz@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org, nobody@gcc.gnu.org,
schmid@snake.iap.physik.tu-darmstadt.de
Cc:
Subject: Re: c++/2295
Date: 19 Mar 2001 21:14:14 -0000
Synopsis: Scope of rand function
State-Changed-From-To: open->analyzed
State-Changed-By: bkoz
State-Changed-When: Mon Mar 19 13:14:14 2001
State-Changed-Why:
This is actually not a libstd++ failure, and is intstead of name lookup error with g++. Here's a smaller testcase that removes library dependencies:
extern "C" int rand (void) throw ();
namespace std
{
extern "C" int rand(void);
template <class _ForwardIter, class _Generator>
void generate(_ForwardIter __first, _ForwardIter __last, _Generator __gen)
{
for ( ; __first != __last; ++__first)
*__first = __gen();
}
}
using namespace std;
int main()
{
int* i;
int* j;
generate(i, j, rand);
return 0;
}
Compiling this with 20010319 g++ gives:
%COMP.sh 2295.cc
2295.cc: In function `int main()':
2295.cc:46: no matching function for call to `generate(int*&, int*&, <unknown
type>)'
Note the odd <unknown type> bits. EDG can compile this normally.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=2295&database=gcc