<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 - max_align_t expected by libc++, but missing in Visual Studio 2019's CRT"
   href="https://bugs.llvm.org/show_bug.cgi?id=49116">49116</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>max_align_t expected by libc++, but missing in Visual Studio 2019's CRT
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libc++
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>11.0
          </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>All Bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>colin@reactos.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I have built libc++ 11.0.1 using Visual Studio 2019's clang-cl 10.0.0 against
the Microsoft CRT (version 14.28.29333).
When compiling any application that includes libc++'s <cstddef>, I get a build
failure:

cstddef(53,9): error : no member named 'max_align_t' in the global namespace


While it's correct that <cstddef> needs to provide std::max_align_t since
C++11, the corresponding max_align_t that libc++ expects in the global
namespace also requires C11 support.
However, Visual Studio and its CRT lack full C11 support.

Visual Studio's STL works around this by defining std::max_align_t to double in
its <cstddef> instead of importing it from the global namespace.
Visual Studio's <stddef.h> lacks any mentioning of max_align_t.


For the moment, I can work around this by adding 'using max_align_t = double;'
to libc++'s <cstddef>. Considering that Clang is now officially supported by
Visual Studio, this needs a proper fix though.
Alternatively, you can officially declare that C++11 support requires C11
support and leave it to Microsoft to add the missing C11 support to Visual
Studio ;)


Note that this is no duplicate of <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - error: no member named 'max_align_t' in the global namespace"
   href="show_bug.cgi?id=20196">bug #20196</a>, which describes a similar issue
with an old non-C11-compliant Clang and a C11-relying GNU libstdc++.</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>