-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)
commit774b584f425df71418bf439cc1f11886f1f4f30f
tree2b0ffe7494cff77b8266cb03887dc7330c2eeb99
parent5ff020a6b60454c67142a24727f18a5cb1521f66
-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.

llvm-svn: 243909
12 files changed:
llvm/include/llvm/Analysis/AliasSetTracker.h
llvm/include/llvm/Analysis/AssumptionCache.h
llvm/include/llvm/Analysis/IVUsers.h
llvm/include/llvm/Analysis/ScalarEvolution.h
llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h
llvm/include/llvm/IR/ValueHandle.h
llvm/include/llvm/IR/ValueMap.h
llvm/lib/Analysis/CFLAliasAnalysis.cpp
llvm/lib/Analysis/LazyValueInfo.cpp
llvm/lib/CodeGen/MachineModuleInfo.cpp
llvm/lib/ExecutionEngine/ExecutionEngine.cpp
llvm/unittests/IR/ValueHandleTest.cpp