[Sema] Fix deleted function problem in implicitly movable test
authorYang Fan <nullptr.cpp@gmail.com>
Mon, 4 Jan 2021 09:36:58 +0000 (17:36 +0800)
committerYang Fan <nullptr.cpp@gmail.com>
Wed, 6 Jan 2021 02:05:40 +0000 (10:05 +0800)
commit74f93bc373d089e757bb65cf8b30b63a4eae8b69
tree6e94d1bd564abf9d189c7a439bbe4b33ee89548a
parentf4bcbdf9cea16bf91ba342268f681de45e15733c
[Sema] Fix deleted function problem in implicitly movable test

In implicitly movable test, a two-stage overload resolution is performed.
If the first overload resolution selects a deleted function, Clang directly
performs the second overload resolution, without checking whether the
deleted function matches the additional criteria.

This patch fixes the above problem.

Reviewed By: Quuxplusone

Differential Revision: https://reviews.llvm.org/D92936
clang/lib/Sema/SemaInit.cpp
clang/lib/Sema/SemaStmt.cpp
clang/test/CXX/class/class.init/class.copy.elision/p3.cpp [new file with mode: 0644]
clang/test/SemaCXX/warn-return-std-move.cpp