[libcxx-commits] [PATCH] D143447: [libc++] Implement P1328R1 constexpr std::type_info::operator==

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Feb 9 04:44:10 PST 2023


mstorsjo added a comment.

In D143447#4115149 <https://reviews.llvm.org/D143447#4115149>, @goncharov wrote:

> good idea, I am in the process of updating windows images anyway. Hopefully will update within a week.

Oh, ok.

FWIW, if you do that right now, you'll end up with Clang 15.0 - while 16.0 is to be released within a month. But on the other hand, there shouldn't be much difference (other than that if we update to 15 right now, we'll probably need to update to 17.0 in the fall - while if we update to 16 when that's released, we can in the best cases leave it untouched until next year).

I.e., if you're not in a hurry and want to postpone it for a couple more weeks, that could save yourself some extra work later in the year, but if you have a reason for doing it now anyway, that's totally fine too.

> Sorry, I am out of context of this diff, how can I check that new setup passes the test?

IIRC the existing dockerfile tried to install explicitly VS 2019 (whatever is the latest version of that), but we'd need to switch to VS 2022 (which is an entirely new major version). As for inspecting whether the test will succeed or not, you'd have to run the build, remove the `UNSUPPORTED: ...` line from the test and see how it behaves - that's probably a fair bit of manual poking.

If you can inspect the built container image, you can have a look at `C:\BuildTools\VC\Tools\MSVC\<version>\include\vcruntime_typeinfo.h`. For current versions, it has something like this:

  class type_info
  {
  public:
  [...]
      bool operator==(const type_info& _Other) const noexcept
      {   
          return __std_type_info_compare(&_Data, &_Other._Data) == 0;
      }

While the newer version has got this:

  class type_info
  {   
  public:
  [...]
      _NODISCARD
  #if _HAS_CXX23
      constexpr
  #endif // _HAS_CXX23
      bool operator==(const type_info& _Other) const noexcept
      {
  #if _HAS_CXX23
          if (__builtin_is_constant_evaluated())
          {   
              return &_Data == &_Other._Data;
          }
  #endif // _HAS_CXX23
  
          return __std_type_info_compare(&_Data, &_Other._Data) == 0;
      }

Or if you can grab the version number of the MSVC installation (the `<version>` bit in the path above) - from some samples I had lying around, `14.32.31326` is too old while `14.33.31629` seems new enough.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D143447/new/

https://reviews.llvm.org/D143447



More information about the libcxx-commits mailing list