-Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are deprecated...
authorDavid Blaikie <dblaikie@gmail.com>
Mon, 3 Aug 2015 22:30:24 +0000 (22:30 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Mon, 3 Aug 2015 22:30:24 +0000 (22:30 +0000)
commitc4423f0478641e9c93d305e6424a9fca53264c71
treee102a06bc545b751e7cd6b1a4dcf4178e6ee5899
parent5647cdb099acd9fd212073121793af56916ca466
-Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are deprecated in C++11

Various value handles needed to be copy constructible and copy
assignable (mostly for their use in DenseMap). But to avoid an API that
might allow accidental slicing, make these members protected in the base
class and make derived classes final (the special members become
implicitly public there - but disallowing further derived classes that
might be sliced to the intermediate type).

Might be worth having a warning a bit like -Wnon-virtual-dtor that
catches public move/copy assign/ctors in classes with virtual functions.
(suppressable in the same way - by making them protected in the base,
and making the derived classes final) Could be fancier and only diagnose
them when they're actually called, potentially.

Also allow a few default implementations where custom implementations
(especially with non-standard return types) were implemented.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243909 91177308-0d34-0410-b5e6-96231b3b80d8
12 files changed:
include/llvm/Analysis/AliasSetTracker.h
include/llvm/Analysis/AssumptionCache.h
include/llvm/Analysis/IVUsers.h
include/llvm/Analysis/ScalarEvolution.h
include/llvm/Analysis/ScalarEvolutionExpressions.h
include/llvm/IR/ValueHandle.h
include/llvm/IR/ValueMap.h
lib/Analysis/CFLAliasAnalysis.cpp
lib/Analysis/LazyValueInfo.cpp
lib/CodeGen/MachineModuleInfo.cpp
lib/ExecutionEngine/ExecutionEngine.cpp
unittests/IR/ValueHandleTest.cpp