This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Invalid code in <limits>
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Theodore Papadopoulo <Theodore dot Papadopoulo at sophia dot inria dot fr>
- Cc: Phil Edwards <phil at jaj dot com>, Gabriel Dos Reis <gdr at integrable-solutions dot net>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>, "rth at redhat dot com" <rth at redhat dot com>
- Date: Wed, 29 Jan 2003 12:24:40 -0800
- Subject: Re: Invalid code in <limits>
--On Wednesday, January 29, 2003 09:04:13 PM +0100 Theodore Papadopoulo
<Theodore.Papadopoulo@sophia.inria.fr> wrote:
mark@codesourcery.com said:
Gaby's examples are trickier. For example:
template <int I>
void f(S<I + 3 + 4>);
is guaranteed by the ABI to be mangled as "I + 3 + 4", not with "I +
7". (The ISO standard explicitly says that these might or might not be
the same template; the ABI says that they are not.)
I did not know that...
But this seems awkward...
Yeah, it is pretty awkward.
Does that mean that I can make different specializations or overloads
on S<I +3 + 4> and on S<I+7> ??
Yes, but what will happen will depend on what compiler you're on. :-)
ISO left this unspecified because some compilers like to fold early
(like EDG, until they implemented the IA64 ABI mangling) and some like
to fold late (like G++), and there are some pretty sticky situations.
Is S<I + 3 + 4> the same as S<I + 4 + 3> or S<I + 4 + 3>?
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com