[PATCH] PR libstdc++/13045 / C++ demangler, floating values and function pointer type return type postfix fix.

Carlo Wood carlo@alinoe.com
Tue Nov 25 22:56:00 GMT 2003


On Tue, Nov 25, 2003 at 10:47:30PM +0100, Gabriel Dos Reis wrote:
> You get +Inf or -Inf only if you ascribe/assume a given data type
> (with a limited precision) of an object that will contain that value.
> I.e. You're getting the value that would be represented in an object,
> while the issue here is that of a *literal* value.  Not quite the same.

I am not sure what you mean, the resulting mangled name
contains Inf - that is what you asked.

_Z1fILi1ELc120EEv1AIXplT_cvingLd7ff0000000000000EEE

~/c++/demangler>c++filt _Z1fILi1ELc120EEv1AIXplT_cvingLd7ff0000000000000EEE 2>/dev/null
void f<1, (char)120>(A<(1) + ((int)(-((double)inf)))>)

Hmm - heh, -Inf is also not possible it seems.

> | > signed zeros are spelt +0 and -0.
> | 
> | Actually, I can't produce a -0 either as literal in
> | a symbol.
> 
> Huh???? 

-0 is interpreted as integer, and -0.0 is interpreted as 0.0.

template <int I, char J> void f(A<I+int(-0.0)>) {}

gives:

_Z1fILi1ELc120EEv1AIXplT_cvingLd0000000000000000EEE

which is

void f<1, (char)120>(A<(1) + ((int)(-((double)0)))>)

same as for the -1e1000

And

template <int I, char J> void f(A<I+int(-0)>) {}
gives of course just

_Z1fILi1ELc120EEv1AIXplT_cvingLi0EEE

I am getting tired of this disussion... when are people
putting floating point values at all in template parameters?
It makes no sense; we are wasting our time.  Lets make
some quick decisions and do useful things again.

-- 
Carlo Wood <carlo@alinoe.com>



More information about the Gcc-patches mailing list