[PATCH] D105951: [clang] P2266 implicit moves STL workaround

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 15 11:17:30 PDT 2021


aaron.ballman added a comment.

In D105951#2880654 <https://reviews.llvm.org/D105951#2880654>, @mibintc wrote:

> Intel compiles VS2019 #include files regularly with clang, and the file <filesystem> compiled with -std:c++latest encounters this error report, which @aaron.ballman suggests is related to this effort.

I think we might be in an awkward situation where some MSVC STL code needs the implicit cast in order to work, such as:

  In file included from c:/Program files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.28.29910/include\string:11:
  c:/Program files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.28.29910/include\xstring(4714,12): error: non-const lvalue reference to type 'basic_istream<...>' cannot bind to a temporary of type 'basic_istream<...>'
      return _Istr;
             ^~~~~

This issue was fixed with the previous workaround. But other MSVC STL code fails without the implicit cast, such as:

  In file included from tst_incl_filesystem.cpp:2:
  c:/Program files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.28.29910/include\filesystem(3099,20): error: call to deleted constructor of 'unique_ptr<wchar_t []>'
              return _Cleaned_link;
                     ^~~~~~~~~~~~~

(At least, Melanie's reduced example fails with this patch, but if you remove the system header or namespace std bits from the test, then it passes.)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105951



More information about the cfe-commits mailing list