This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/8861] [3.3/3.4 regression] [ABI] mangling floating point literal in template arg expression
- From: "zack at codesourcery dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Jun 2003 20:21:12 -0000
- Subject: [Bug c++/8861] [3.3/3.4 regression] [ABI] mangling floating point literal in template arg expression
- References: <20021207125600.8861.catherin@ca.ibm.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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