<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/113207>113207</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            conj is not tagged with __DEVICE__
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          aminiussi
      </td>
    </tr>
</table>

<pre>
    In 'clang/lib/Headers/openmp_wrappers/complex_cmath.h', conj is not tagged with `__DEVICE__`. As a result it is not marcked constexpr (as other functions in that header).

Now, that file is included by 'clang/lib/Headers/openmp_wrappers/complex' which in turn includes the platform complex header, which can/will include gcc complex header. 

But it seems that with gcc-12 and current version, [it is constexpr](https://github.com/gcc-mirror/gcc/blob/cb131a401b7489cc17e2d70420cf9a916515b3f6/libstdc%2B%2B-v3/include/std/complex#L91) (or at least as constepxr as 'norm', which is tagged '__DEVICE__')

So there seems to be an inconsistency which results in:

```
In file included from /opt/cray/pe/cce/17.0.0/cce-clang/x86_64/lib/clang/17/include/openmp_wrappers/complex:51:
/opt/cray/pe/cce/17.0.0/cce-clang/x86_64/lib/clang/17/include/openmp_wrappers/complex_cmath.h:68:40: error: non-constexpr declaration of 'conj' follows constexpr declaration
 68 | template <class _Tp> std::complex<_Tp> conj(const std::complex<_Tp> &__c) {
      | ^
/opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/complex:709:5: note: previous declaration is here
  709 |     conj(const complex<_Tp>& __z)
      |     ^
1 error generated.
```

The problem arise with Cray's flavor of clang++ (which is a clang++ to which they add bugs apparently):

```
21:15:49 [alainm@login4 rel]#CC --version
Cray clang version 17.0.0  (b59b7a8e9169719529cf5ab440f3c301e515d047)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/cray/pe/cce/17.0.0/cce-clang/x86_64/share/../bin
21:17:13 [alainm@login4 rel]#
```

So I understand that Cray issues are their issues but header wise, there seems to be an inconsistency since, if llvm headers includes the gnu headers, the constexpr modifiers of complex function should follow, right ?

thanks
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8Vk1v4zwO_jXKhUhgy1_xIYc0bbAFFnuZwV4DWaZtzciSIclNu79-QX8k6exOX2AObxDIkC1R5MPnISW8V61BPLDsiWXPGzGGzrqD6JVRo_dqU9n64_BqgPFCamFaxs9aVYyf_4GiRucZP9sBTT9crk4Mw_xG2n7Q-H6RvQjdrmO8YPwE0pofoDwYGyCItsUarip0wPLocnl--ffr6eVyYXm0g6MHAQ79qAOosO7phZM_sSY7PuD74IDxvfBgQ4cOmtHIoKzxoAyETgToJg8ZL3csembRcR7_Za_kzLSiURrJujJSjzXWUH38UaCMF3DtlOyms0dnVoseQocwaBEa63pYlt88Oy27pDCMn69K63UjtFL-snwHj2E8jRM0HrH3czATlq2U25iDMDXI0Tk0Ad7QeWUNncaypxnOG4Qse2Z834UweJYcGT8zfm5V6MZqJ21PEym3vXLOunnC-LnSlnCRVZzEIo3iqkj3pZRxgbwuopRHsilFGedZnFVJk89A-lBLxjP-NA3bt4Tx8xIr42cf6kc0k3-WMeMl5dc6EAE0Ch9ArI4P744mjBfGun6h15IAv3KL8eKBVrSmfATwm6XcOFwhtFAhiClz1njlAxr5sRidqUg8IZAejLA8Wv7T9NUslFr51Djbw8ScQPE58cH4eaCIpaQxLnbRLpqn25V27_v8kqc3_q2v4-ITZL8nY3LM4ruff-_hN8knx3zPkmMaseQIOPEnOYKxZnuXb41SCydItWCbSXnW_CAxNVZre33g6ePaOTDI98CKEwTsSV8ILDlJLbyHy_eBJS9AnEqOLDnecDktX-ZT9pPxL5Yxnl8ucuJh8bQcOv3oWJa9_AKw6xa5BGu1x7CNOb21lj6O3t0wnVU0A711WHcibLUy4zvhTHt2u_8d7thLRiJ6Whffs15EJeV-xjkgPQeHb8qO_hPUygMRf42oiMopIvp9QuZXQBjP4XL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