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

[Bug c++/8861] [3.3/3.4 regression] [ABI] mangling floating point literal in template arg expression


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8861



------- Additional Comments From zack@codesourcery.com  2003-06-09 20:21 -------
Subject: Re:  PATCH: mangling floating point literal in
 template 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]