From: David Blaikie Date: Sat, 1 Aug 2015 01:08:30 +0000 (+0000) Subject: -Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are deprecated... X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=commitdiff_plain;h=8bf187c91fc43a375270f131341780b0e6a20f80 -Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are deprecated in C++11 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243816 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/utils/TableGen/AsmMatcherEmitter.cpp b/utils/TableGen/AsmMatcherEmitter.cpp index 0d7c5ffbea1..d4a0616584b 100644 --- a/utils/TableGen/AsmMatcherEmitter.cpp +++ b/utils/TableGen/AsmMatcherEmitter.cpp @@ -460,6 +460,20 @@ struct MatchableInfo { TheDef->getValueAsBit("UseInstAsmMatchConverter")) { } + // Could remove this and the dtor if PointerUnion supported unique_ptr + // elements with a dynamic failure/assertion (like the one below) in the case + // where it was copied while being in an owning state. + MatchableInfo(const MatchableInfo &RHS) + : AsmVariantID(RHS.AsmVariantID), AsmString(RHS.AsmString), + TheDef(RHS.TheDef), DefRec(RHS.DefRec), ResOperands(RHS.ResOperands), + Mnemonic(RHS.Mnemonic), AsmOperands(RHS.AsmOperands), + RequiredFeatures(RHS.RequiredFeatures), + ConversionFnKind(RHS.ConversionFnKind), + HasDeprecation(RHS.HasDeprecation), + UseInstAsmMatchConverter(RHS.UseInstAsmMatchConverter) { + assert(!DefRec.is()); + } + ~MatchableInfo() { delete DefRec.dyn_cast(); }