From: David Blaikie Date: Thu, 13 Aug 2015 23:15:20 +0000 (+0000) Subject: Wdeprecated: Make Filter safely move constructible. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7f83e701f4a48112ba41e981a49febfc1a8423c1;p=clang Wdeprecated: Make Filter safely move constructible. makeFilter returns Filters by value which seems to be only safe when the copy doesn't occur and RVO kicks in. Make the object safely movable to support this more reliably. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@244983 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Sema/Lookup.h b/include/clang/Sema/Lookup.h index bc9cf4279a..bc8574c201 100644 --- a/include/clang/Sema/Lookup.h +++ b/include/clang/Sema/Lookup.h @@ -575,6 +575,11 @@ public: {} public: + Filter(Filter &&F) + : Results(F.Results), I(F.I), Changed(F.Changed), + CalledDone(F.CalledDone) { + F.CalledDone = true; + } ~Filter() { assert(CalledDone && "LookupResult::Filter destroyed without done() call");