summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/special/class.copy/p11.0x.copy.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fold -Wreturn-stack-address into general initialization lifetimeRichard Smith2018-07-231-4/+3
| | | | | | checking. llvm-svn: 337743
* Restructure checking for, and warning on, lifetime extension.Richard Smith2018-07-171-2/+11
| | | | | | | | | | | | | This change implements C++ DR1696, which makes initialization of a reference member of a class from a temporary object ill-formed. The standard wording here is imprecise, but we interpret it as meaning that any time a mem-initializer would result in lifetime extension, the program is ill-formed. This reinstates r337226, reverted in r337255, with a fix for the InitializedEntity alignment problem that was breaking ARM buildbots. llvm-svn: 337329
* Temporarily revert r337226 "Restructure checking for, and warning on, ↵Florian Hahn2018-07-171-11/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | lifetime extension." This change breaks on ARM because pointers to clang::InitializedEntity are only 4 byte aligned and do not have 3 bits to store values. A possible solution would be to change the fields in clang::InitializedEntity to enforce a bigger alignment requirement. The error message is llvm/include/llvm/ADT/PointerIntPair.h:132:3: error: static_assert failed "PointerIntPair with integer size too large for pointer" static_assert(IntBits <= PtrTraits::NumLowBitsAvailable, include/llvm/ADT/PointerIntPair.h:73:13: note: in instantiation of template class 'llvm::PointerIntPairInfo<const clang::InitializedEntity *, 3, llvm::PointerLikeTypeTraits<const clang::InitializedEntity *> >' requested here Value = Info::updateInt(Info::updatePointer(0, PtrVal), llvm/include/llvm/ADT/PointerIntPair.h:51:5: note: in instantiation of member function 'llvm::PointerIntPair<const clang::InitializedEntity *, 3, (anonymous namespace)::LifetimeKind, llvm::PointerLikeTypeTraits<const clang::InitializedEntity *>, llvm::PointerIntPairInfo<const clang::InitializedEntity *, 3, llvm::PointerLikeTypeTraits<const clang::InitializedEntity *> > >::setPointerAndInt' requested here setPointerAndInt(PtrVal, IntVal); ^ llvm/tools/clang/lib/Sema/SemaInit.cpp:6237:12: note: in instantiation of member function 'llvm::PointerIntPair<const clang::InitializedEntity *, 3, (anonymous namespace)::LifetimeKind, llvm::PointerLikeTypeTraits<const clang::InitializedEntity *>, llvm::PointerIntPairInfo<const clang::InitializedEntity *, 3, llvm::PointerLikeTypeTraits<const clang::InitializedEntity *> > >::PointerIntPair' requested here return {Entity, LK_Extended}; Full log here: http://lab.llvm.org:8011/builders/clang-cmake-armv7-global-isel/builds/1330 http://lab.llvm.org:8011/builders/clang-cmake-armv7-full/builds/1394 llvm-svn: 337255
* Restructure checking for, and warning on, lifetime extension.Richard Smith2018-07-171-2/+11
| | | | | | | | | | This change implements C++ DR1696, which makes initialization of a reference member of a class from a temporary object ill-formed. The standard wording here is imprecise, but we interpret it as meaning that any time a mem-initializer would result in lifetime extension, the program is ill-formed. llvm-svn: 337226
* When a special member is explicitly defaulted outside its class, and we rejectRichard Smith2014-01-221-2/+2
| | | | | | | the defaulting because it would delete the member, produce additional notes explaining why the member is implicitly deleted. llvm-svn: 199829
* Unify lookup from within not-yet-defined defaulted special members: use commonRichard Smith2013-11-271-0/+19
| | | | | | | code for handling triviality, deletedness and constexpr. Fix a few bugs in these, particularly related to mutable members, and remove some dead code. llvm-svn: 195809
* Take cv-qualifiers on fields of class type into account when determiningRichard Smith2013-11-251-0/+7
| | | | | | whether a defaulted special member function should be deleted. llvm-svn: 195620
* Move detection of reference members binding to temporaries from building ofRichard Smith2013-06-121-0/+1
| | | | | | | CXXCtorInitializers to the point where we perform the questionable lifetime extension. This exposed a selection of false negatives in the warning. llvm-svn: 183869
* PR13381, part 2: when determining if a defaulted special member function shouldRichard Smith2012-07-181-0/+12
| | | | | | | | be defined as deleted, take cv-qualifiers on class members into account when looking up the copy or move constructor or assignment operator which will be used for them. llvm-svn: 160418
* [class.copy]p23: Fix an assertion caused by incorrect argument numbering in aRichard Smith2012-04-291-2/+2
| | | | | | | diagnostic, add a test for this paragraph, and tighten up the diagnostic wording a little. llvm-svn: 155784
* PR10217: Provide diagnostics explaining why an implicitly-deleted specialRichard Smith2012-03-301-18/+18
| | | | | | member function is deleted. llvm-svn: 153773
* Add a pile of tests for unrestricted unions, and advertise support for them.Richard Smith2012-03-031-0/+31
| | | | llvm-svn: 151992
* When overload resolution picks an implicitly-deleted special memberDouglas Gregor2012-02-151-7/+7
| | | | | | | | | function, provide a specialized diagnostic that indicates the kind of special member function (default constructor, copy assignment operator, etc.) and that it was implicitly deleted. Add a hook where we can provide more detailed information later. llvm-svn: 150611
* Update all tests other than Driver/std.cpp to use -std=c++11 rather thanRichard Smith2011-10-131-1/+1
| | | | | | -std=c++0x. Patch by Ahmed Charles! llvm-svn: 141900
* Consolidate copy constructor deletion into ShouldDeleteSpecialMember.Alexis Hunt2011-10-111-0/+90
llvm-svn: 141645
OpenPOWER on IntegriCloud