<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 - Value of _MSVC_LANG should be larger than 202002L in C++2b mode"
   href="https://bugs.llvm.org/show_bug.cgi?id=51462">51462</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Value of _MSVC_LANG should be larger than 202002L in C++2b mode
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </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>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>C++2b
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>ensadc@mailnesia.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>blitzrakete@gmail.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Currently _MSVC_LANG is defined as 201705L both in C++20 mode (/std:c++20 for
clang-cl) and in C++2b mode (/std:c++latest for clang-cl). This prevents
library code from discovering whether C++2b features are enabled.

The relevant code is in
<a href="https://github.com/llvm/llvm-project/blob/1e11ccad837c2d0d848349e7bc8f5800e5d365fc/clang/lib/Basic/Targets/OSTargets.cpp#L183-L190">https://github.com/llvm/llvm-project/blob/1e11ccad837c2d0d848349e7bc8f5800e5d365fc/clang/lib/Basic/Targets/OSTargets.cpp#L183-L190</a>
:

    if (Opts.isCompatibleWithMSVC(LangOptions::MSVC2015)) {
      if (Opts.CPlusPlus20)
        Builder.defineMacro("_MSVC_LANG", "201705L");
      else if (Opts.CPlusPlus17)
        Builder.defineMacro("_MSVC_LANG", "201703L");
      else if (Opts.CPlusPlus14)
        Builder.defineMacro("_MSVC_LANG", "201402L");
    }

For the reference, MSVC 2022 preview 3 (latest MSVC as of now) uses 202002L for
C++20 and 202004L for C++2b.</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>