llvm-project/clang/test/CXX/special/class.copy
Richard Smith 6b02d46dae Finish implementing 'selected constructor' rules for triviality in C++11. In
the cases where we can't determine whether special members would be trivial
while building the class, we eagerly declare those special members. The impact
of this is bounded, since it does not trigger implicit declarations of special
members in classes which merely *use* those classes.

In order to determine whether we need to apply this rule, we also need to
eagerly declare move operations and destructors in cases where they might be
deleted. If a move operation were supposed to be deleted, it would instead
be suppressed, and we could need overload resolution to determine if we fall
back to a trivial copy operation. If a destructor were implicitly deleted,
it would cause the move constructor of any derived classes to be suppressed.

As discussed on cxx-abi-dev, C++11's selected constructor rules are also
retroactively applied as a defect resolution in C++03 mode, in order to
identify that class B has a non-trivial copy constructor (since it calls
A's constructor template, not A's copy constructor):

struct A { template<typename T> A(T &); };
struct B { mutable A a; };

llvm-svn: 169673
2012-12-08 08:32:28 +00:00
..
implicit-move-def.cpp Make test work with ARM C++ ABI. 2011-11-01 03:30:32 +00:00
implicit-move.cpp PR12625: Cope with classes which have incomplete base or member types: 2012-04-25 18:28:49 +00:00
p3.cpp
p8-cxx11.cpp Prior to adding the new "expected-no-diagnostics" directive to VerifyDiagnosticConsumer, make the necessary adjustment to 580 test-cases which will henceforth require this new directive. 2012-10-19 12:44:48 +00:00
p9.cpp Provide overload diagnostics when explicit casts involving class types fail. 2011-02-14 18:34:10 +00:00
p11.0x.copy.cpp PR13381, part 2: when determining if a defaulted special member function should 2012-07-18 03:51:16 +00:00
p11.0x.move.cpp Implement DR1402: if a field or base class is not movable, the derived class's 2012-04-02 18:40:40 +00:00
p12-0x.cpp Finish implementing 'selected constructor' rules for triviality in C++11. In 2012-12-08 08:32:28 +00:00
p13-0x.cpp PR13051: If a constructor is explicitly defaulted, it isn't marked as being 2012-06-08 21:09:22 +00:00
p15-0x.cpp Prior to adding the new "expected-no-diagnostics" directive to VerifyDiagnosticConsumer, make the necessary adjustment to 580 test-cases which will henceforth require this new directive. 2012-10-19 12:44:48 +00:00
p15-inclass.cpp hopefully fix a bunch of ARM buildbot failures 2012-05-09 21:21:49 +00:00
p18-cxx11.cpp Store on the CXXRecordDecl whether the class has, or would have, a copy 2012-11-28 06:23:12 +00:00
p20.cpp Test implicit declaration of copy assignment operator with non-const argument 2010-07-01 20:08:52 +00:00
p23-cxx11.cpp PR13381, part 2: when determining if a defaulted special member function should 2012-07-18 03:51:16 +00:00
p25-0x.cpp Finish implementing 'selected constructor' rules for triviality in C++11. In 2012-12-08 08:32:28 +00:00
p28-cxx11.cpp Fix some wrong-code bugs in implicitly-defined assignment operators: 2012-11-13 00:54:12 +00:00
p33-0x.cpp Update all tests other than Driver/std.cpp to use -std=c++11 rather than 2011-10-13 22:29:44 +00:00