[PATCH] D92936: [Sema] Fix deleted function problem in implicitly movable test

Arthur O'Dwyer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 4 13:32:16 PST 2021


Quuxplusone added a comment.

In D92936#2477764 <https://reviews.llvm.org/D92936#2477764>, @dmajor wrote:

> Before the revert, our bots hit the following issue where we only error out when `-Wall` is given, so there's definitely something strange going on.

https://godbolt.org/z/P1dv9f
Yeah, I see what's happening here. `-Wall` turns on `-Wreturn-std-move`, which in C++17 mode does a preliminary overload resolution "as if by std::move" just to see what would happen. This preliminary overload resolution finds a deleted function, and apparently this is a hard error — we're not doing whatever dance Clang requires in order to suppress/defer diagnostics during "speculative" compilation. (The difficulty of speculatively compiling things is one of my pet peeves with Clang.)

Here's an example using Clang trunk to produce a hard error from the guts of `-Wreturn-std-move` (left-hand pane) but no error if you don't enable that warning (right-hand pane).
https://godbolt.org/z/e6zPsb
However, this might be Clang-trunk-including-Yang's-patch, I'm not sure.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92936



More information about the cfe-commits mailing list