This is the mail archive of the gcc-patches@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: [Bug c++/8861] PATCH: mangling floating point literal intemplate arg expression


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


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