This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Invalid code in <limits>
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Theodore Papadopoulo <Theodore dot Papadopoulo at sophia dot inria dot fr>
- Cc: Mark Mitchell <mark at codesourcery dot com>, Phil Edwards <phil at jaj dot com>, "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: 30 Jan 2003 13:58:07 +0100
- Subject: Re: Invalid code in <limits>
- Organization: Integrable Solutions
- References: <200301292004.h0TK4DMv016823@mururoa.inria.fr>
Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr> writes:
| 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...
|
| Does that mean that I can make different specializations or overloads
| on S<I +3 + 4> and on S<I+7> ??
That is ill-formed but no diagnostic is required. In that case, ISO
C++ says that the two templates are /functionnally equivalent/
without being /equivalent/ (token-based notion). That is ill-formed
and no diagnostic is required.
-- Gaby