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: "nathan at codesourcery dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Jun 2003 11:30:34 -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 nathan@codesourcery.com 2003-06-10 11:30 -------
Subject: Re: Revised patch - floating point literal mangling
Richard Earnshaw wrote:
> I'm surprised, given that
>
> template <int I> void f(A<I+int(1.234+1.234)> a) { ... }
this is ill-formed. a non-type argment must be ...
an integral constant expression ...
an integral constant expression can involve only ... floating
literals only if they are cast to integral or enumeration type ...
>
> and
>
> template <int I> void f(A<I+int(2.468)> a) { ... }
>
> don't mangle identically, that a representation of the literal *as it
> appeared in the source* isn't used.
Even
template <int I> void f(A<I+4>);
and
template <int I> void f(A<I+1+3>);
is ill-formed, no diagnostic required. [14.5.5.1]/8
They are neither guaranteed identical no guaranteed different.
nathan