using __float128 and -std=c++11

Peter van Hoof p.vanhoof@oma.be
Tue Oct 13 09:27:00 GMT 2015


Consider the following program

#include <quadmath.h>
__float128 a()
{
	return FLT128_MAX;
}

When I compile this with any of these commands

g++ -c prog.cc
g++ -std=c++98 -c prog.cc
g++ -std=c++03 -c prog.cc

it compiles just fine. However, when I use this

g++ -std=c++11 -c prog.cc

I get the error message

In file included from prog.cc:1:0:
prog.cc: In function ‘__float128 a()’:
prog.cc:5:9: error: unable to find numeric literal operator ‘operator"" Q’
   return FLT128_MAX;
          ^
I suspect this is a compiler bug, but would like to double-check first 
before submitting a report. The compiler doesn't complain about the use 
of __float128, so I guess that type is deemed compliant with the C++11 
standard. So I would assume that I should also be allowed to use 
__float128 literals...



More information about the Gcc-help mailing list