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>


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


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