This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: function name lookup within templates in gcc 4.1
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: "Gareth Pearce" <tilps at probablyprime dot net>
- Cc: <gcc at gcc dot gnu dot org>
- Date: Sun, 17 Apr 2005 22:43:37 -0400
- Subject: Re: function name lookup within templates in gcc 4.1
- References: <200504180238.j3I2cQQd026738@bethe.phy.uc.edu>
On Apr 17, 2005, at 10:37 PM, Gareth Pearce wrote:
So I just started trying out gcc 4.1 - with a program which compiles
and
runs fine on gcc 3.3.
Attached is a reduced testcase which shows runtime segfault due to
stack
overflow if compiled with 4.1 but does not with 3.3. Trivial work
around is
to move the specific declaration above the template definition. Now I
see
potential for this to be 'the way the standard wants it to be', but
given I
don't have a copy of the standard I am unsure.
Should I report this as a bug or is it a standards compliance
improvement?
This is a standards compliance improvement as x is not dependent so the
function
call to recurse has to be looked up of the available functions at
decoration
time of the template function.
The easy way is to fix your code is to add:
int recurse(const sstring_t& blah);
before declaring the template version.
Thanks,
Andrew Pinski