llvm-project/clang/unittests
Richard Smith 96cd671cd6 PR19668, PR23034: Fix handling of move constructors and deleted copy
constructors when deciding whether classes should be passed indirectly.

This fixes ABI differences between Clang and GCC:

 * Previously, Clang ignored the move constructor when making this
   determination. It now takes the move constructor into account, per
   https://github.com/itanium-cxx-abi/cxx-abi/pull/17 (this change may
   seem recent, but the ABI change was agreed on the Itanium C++ ABI
   list a long time ago).

 * Previously, Clang's behavior when the copy constructor was deleted
   was unstable -- depending on whether the lazy declaration of the
   copy constructor had been triggered, you might get different behavior.
   We now eagerly declare the copy constructor whenever its deletedness
   is unclear, and ignore deleted copy/move constructors when looking for
   a trivial such constructor.

This also fixes an ABI difference between Clang and MSVC:

 * If the copy constructor would be implicitly deleted (but has not been
   lazily declared yet), for instance because the class has an rvalue
   reference member, we would pass it directly. We now pass such a class
   indirectly, matching MSVC.

Based on a patch by Vassil Vassilev, which was based on a patch by Bernd
Schmidt, which was based on a patch by Reid Kleckner!

This is a re-commit of r310401, which was reverted in r310464 due to ARM
failures (which should now be fixed).

llvm-svn: 310983
2017-08-16 01:49:53 +00:00
..
AST Revert "Lexer: always allow imaginary constants in GNU mode." 2017-08-08 23:17:51 +00:00
ASTMatchers PR19668, PR23034: Fix handling of move constructors and deleted copy 2017-08-16 01:49:53 +00:00
Analysis [analyzer] Reland r299544 "Add a modular constraint system to the CloneDetector" 2017-04-06 14:34:07 +00:00
Basic Use VFS operations in FileManager::makeAbsolutePath. 2017-08-02 07:25:24 +00:00
CodeGen Make sure the LLVMContext outlive the CompilerInstance 2016-04-14 05:37:41 +00:00
Driver [Driver] Actually report errors during parsing instead of stopping when there's an error somewhere. 2017-06-30 13:21:27 +00:00
Format clang-format: [JS] wrap optional properties in type aliases. 2017-08-14 16:09:08 +00:00
Frontend Remove 'Filename' parameter from BeginSourceFileAction. 2017-06-09 01:36:10 +00:00
Lex [Lexer] Finding beginning of token with escaped new line 2017-08-10 10:06:16 +00:00
Rename Use add_clang_unittest in the CMakeLists.txt for the moved unittest 2017-06-30 16:43:00 +00:00
Rewrite Remove autoconf support 2016-01-26 21:30:40 +00:00
Sema [Sema] Allow an external sema source to handle delayed typo corrections. 2016-05-19 10:46:10 +00:00
StaticAnalyzer Add a method to get the list of registered static analyzer checkers. 2016-11-08 07:23:32 +00:00
Tooling Added `applyAtomicChanges` function. 2017-07-31 09:22:34 +00:00
libclang Fixed more signed/unsigned mismatch warnings introduced in my change at r279076 2016-08-18 20:56:48 +00:00
CMakeLists.txt [refactor] Move clang-rename into the clang repository 2017-06-30 16:36:09 +00:00