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

            Bug ID: 90423
           Summary: Breakage with C++ <cmath> and "-mlong-double-128"
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mar...@mpa-garching.mpg.de
  Target Milestone: ---

Compiling the code snippet below with "g++ -mlong-double-128" and running the
executable prints "2" to the console on my machine, which is obviously wrong.
Without the "-mlong-double-128" flag the output is correct.

#include <iostream>
#include <cmath>

using namespace std;

int main()
  {
  long double v=2.;
  cout << double(sqrt(v)) << endl;
  }

I understand that C++ support for this kind of long doubles may not be
complete, but would it be possible to fail in a more obvious manner?

Reproduced with g++ 8 and trunk on x86_64-pc-linux-gnu.

Reply via email to