This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Bug c++/8861] PATCH: mangling floating point literal intemplate arg expression
- From: Zack Weinberg <zack at codesourcery dot com>
- To: Alexandre Oliva <aoliva at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, gcc-bugzilla at gcc dot gnu dot org
- Date: Mon, 09 Jun 2003 13:21:02 -0700
- Subject: Re: [Bug c++/8861] PATCH: mangling floating point literal intemplate arg expression
- References: <871xy4zbkq.fsf@egil.codesourcery.com><oradcrdn11.fsf@free.redhat.lsd.ic.unicamp.br>
Alexandre Oliva <aoliva@redhat.com> writes:
> On Jun 8, 2003, Zack Weinberg <zack@codesourcery.com> wrote:
>
>> (b) this is no longer described as an extension.
>
> But isn't it an extension to the C++ language? IIRC, floating point
> constants are ill-formed if used as template arguments.
As unadorned template arguments, yes, but consider
template <int I> class A { ... };
template <int I> void f(A<I+int(1.234)> a) { ... }
which is strictly conforming. The ABI specifies that I+int(1.234) is
not constant-folded, so there must be some way to encode the
floating-point number.
zw