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

Matheus Izvekov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 15 15:14:32 PDT 2021


mizvekov updated this revision to Diff 359145.
mizvekov added a comment.
Herald added a subscriber: lxfind.

Patch update:

- Fixes issue where the workaround would completely supress implicit moves.
- Improve tests to cover this issue.
- Stop applying the workaround to throw expressions, as we have not observed any problems there.

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 used creduce with the same command line, looking for that error diagnostic with std:c++latest versus no diagnostic with std:c++20 ; this smaller test case, with a few edits, is the result

Thanks for testing!

In D105951#2880920 <https://reviews.llvm.org/D105951#2880920>, @aaron.ballman wrote:

> I think we might be in an awkward situation where some MSVC STL code needs the implicit cast in order to work, such as:
> ....
> (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.)

No, that was totally my fault! :-)

I did not intend for the workaround to completely disable implicit moves, just that it would fall back to the C++20 behavior.

The problem is that the code path for this is split around multiple places, and while suppressing simpler implicit moves here, I should have undone the suppressing of the C++20 implicit move code path elsewhere!

Sigh, I forgot it was there because I was working on another patch that completely removed that second code path...
Sorry for that!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105951

Files:
  clang/include/clang/Sema/Sema.h
  clang/lib/Frontend/InitPreprocessor.cpp
  clang/lib/Sema/SemaCoroutine.cpp
  clang/lib/Sema/SemaStmt.cpp
  clang/test/SemaCXX/cxx2b-p2266-disable-with-msvc-compat.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105951.359145.patch
Type: text/x-patch
Size: 16588 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210715/13a81232/attachment-0001.bin>


More information about the cfe-commits mailing list