llvm-project/clang/unittests/ASTMatchers
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
..
Dynamic Use EXPECT_TRUE rather than EXPECT_EQ(true, ...) to clean up the code and silence a null conversion warning. 2017-07-14 02:03:03 +00:00
ASTMatchersInternalTest.cpp Dividied ASTMatcherTests into 4 files 2016-05-17 19:22:57 +00:00
ASTMatchersNarrowingTest.cpp PR19668, PR23034: Fix handling of move constructors and deleted copy 2017-08-16 01:49:53 +00:00
ASTMatchersNodeTest.cpp [ASTMatcher] Add handling for DeducedType to HasDeclarationMatcher 2017-08-04 18:59:19 +00:00
ASTMatchersTest.h Added braces to work around gcc warning in googletest: suggest explicit braces to avoid ambiguous 'else'. NFC. 2017-06-15 21:01:24 +00:00
ASTMatchersTraversalTest.cpp Unify and simplify the behavior of the hasDeclaration matcher. 2017-08-02 13:04:44 +00:00
CMakeLists.txt Dividied ASTMatcherTests into 4 files 2016-05-17 19:22:57 +00:00