https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113770

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Masahide Kashiwagi from comment #0)
> I have noticed that the following simple program will not complie
> with g++ 13.2.0 on ubuntu 23.04 .
> 
> #include <iostream>
> 
> int main()
> {
>         _Float64x a;
> 
>         std::cin >> a;

This is expected, _Float64x is not defined in any C++ standard, and there is no
support for it in the standard library.

> }
> 
> It compiles fine with long double and __float80.

Of course, because long double is a standard type, and __float80 is a typedef
for long double on x86_64.

> Also no problem with clang++ 16.0.6.
> 
> I also noticed that with _Float64x, the numeric_limits<_Float64x> return 0,

That's also expected. It's not a standard type, and the standard library
doesn't know anything about it.

> as shown below.
> 
> #include <iostream>
> #include <limits>
> 
> int main()
> {
>         std::cout << std::numeric_limits<_Float64x>::epsilon() << std::endl;
>         std::cout << std::numeric_limits<_Float64x>::max() << std::endl;
>         std::cout << std::numeric_limits<_Float64x>::min() << std::endl;
>         std::cout << std::numeric_limits<_Float64x>::infinity() << std::endl;
> }
> 
> This program returns 0:
> 
> 0
> 0
> 0
> 0
> 
> With long double and __float80, the program returns correct values:
> 
> 1.0842e-19
> 1.18973e+4932
> 3.3621e-4932
> inf

For the same reason given above.

> It seems to me that g++ 13 cannot handle _Float64 correctly.

I assume that's a typo, as it handles _Float64 properly, because that's
std::float64_t which is a standard type.

> Is there any way to deal with this?

Don't use _Float64x in C++?

Reply via email to