<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 - tgmath.h broken when compiling C with clang-cl"
   href="https://bugs.llvm.org/show_bug.cgi?id=46207">46207</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>tgmath.h broken when compiling C with clang-cl
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Runtime Libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Windows NT
          </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>libc
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>stwish@microsoft.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The Universal CRT does not have a conforming complex.h. The tgmath.h header in
Clang
(<a href="https://github.com/llvm/llvm-project/blob/4cf5743b7784b2c2bff8be82e1a5cc37f8c68a36/clang/lib/Headers/tgmath.h">https://github.com/llvm/llvm-project/blob/4cf5743b7784b2c2bff8be82e1a5cc37f8c68a36/clang/lib/Headers/tgmath.h</a>)
assumes a conforming complex.h and therefore cannot be compiled by clang-cl
when building as C.

Repro:

**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.7.0-pre.3.0
** Copyright (c) 2020 Microsoft Corporation
**********************************************************************

C:\Users\stwish\source>set "PATH=C:\Program Files (x86)\Microsoft Visual
Studio\2019\Preview\VC\Tools\Llvm\bin;%PATH%"

C:\Users\stwish\source>type tgmath_repro.c
#include <tgmath.h>

int main()
{
    return 0;
}

C:\Users\stwish\source>clang-cl tgmath_repro.c -ferror-limit=1
In file included from tgmath_repro.c:1:
C:\Program Files (x86)\Microsoft Visual
Studio\2019\Preview\VC\Tools\Llvm\lib\clang\10.0.0\include\tgmath.h(72,50):
error: passing
      '_Complex float' to parameter of incompatible type '_Fcomplex' (aka
'struct _C_float_complex')
    __tg_acos(float _Complex __x) {return cacosf(__x);}
                                                 ^~~
C:\Program Files (x86)\Windows
Kits\10\include\10.0.19620.0\ucrt\complex.h(98,50): note: passing argument to
parameter '_Z' here
_ACRTIMP _Fcomplex __cdecl cacosf(_In_ _Fcomplex _Z);
                                                 ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
2 errors generated.</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>