This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Bug 8861] Revised patch - floating point literal mangling
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: Richard dot Earnshaw at arm dot com
- Cc: Zack Weinberg <zack at codesourcery dot com>, gcc-patches at gcc dot gnu dot org, gcc-bugzilla at gcc dot gnu dot org, Mark Mitchell <mark at codesourcery dot com>
- Date: Tue, 10 Jun 2003 12:29:50 +0100
- Subject: Re: [Bug 8861] Revised patch - floating point literal mangling
- Organization: Codesourcery LLC
- References: <200306101109.h5AB9P402396@pc960.cambridge.arm.com>
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
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
The voices in my head said this was stupid too
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk