This is the mail archive of the gcc@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]

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


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