<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - std::fpclassify missing long double when offload is enabled"
   href="https://bugs.llvm.org/show_bug.cgi?id=42799">42799</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>std::fpclassify missing long double when offload is enabled
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>OpenMP
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Clang Compiler Support
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>xw111luoye@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>std::fpclassify(long double) when offload is enabled

#include <cmath>

int main()
{
  long double a(0);
  return (std::fpclassify(a) == 2);
}

clang++ -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda test.cpp 
test.cpp:6:11: error: call to 'fpclassify' is ambiguous
  return (std::fpclassify(a) == 2);
          ^~~~~~~~~~~~~~~
/home/yeluo/opt/llvm-clang/mirror-20190727/lib/clang/10.0.0/include/__clang_cuda_math_forward_declares.h:103:16:
note: candidate function
__DEVICE__ int fpclassify(double);
               ^
/home/yeluo/opt/llvm-clang/mirror-20190727/lib/clang/10.0.0/include/__clang_cuda_math_forward_declares.h:104:16:
note: candidate function
__DEVICE__ int fpclassify(float);
               ^
1 error generated.

A simple fix is in
lib/Headers/__clang_cuda_math_forward_declares.h
add
+__DEVICE__ int fpclassify(long double);
 __DEVICE__ int fpclassify(double);
 __DEVICE__ int fpclassify(float);

clang++ -v
clang version 10.0.0 (<a href="https://github.com/llvm-mirror/clang.git">https://github.com/llvm-mirror/clang.git</a>
0345de1b90a4c75cd7e47505bebbbcf46b841940)
(<a href="https://github.com/llvm-mirror/llvm.git">https://github.com/llvm-mirror/llvm.git</a>
c64f519ea0da2c3bf49a4e421c25a82b66230a17)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/yeluo/opt/llvm-clang/mirror-latest/bin
Found candidate GCC installation:
/opt/gcc/6.5.0/lib/gcc/x86_64-pc-linux-gnu/6.5.0
Selected GCC installation: /opt/gcc/6.5.0/lib/gcc/x86_64-pc-linux-gnu/6.5.0
Candidate multilib: .;@m64
Selected multilib: .;@m64
Found CUDA installation: /usr/local/cuda-10.1, version 10.1</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>