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

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to