]> granicus.if.org Git - clang/commitdiff
Wdeprecated: Make Filter safely move constructible.
authorDavid Blaikie <dblaikie@gmail.com>
Thu, 13 Aug 2015 23:15:20 +0000 (23:15 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Thu, 13 Aug 2015 23:15:20 +0000 (23:15 +0000)
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

include/clang/Sema/Lookup.h

index bc9cf4279ace1e2e82947476f402cc103b63e65b..bc8574c201677193c02a35d7855f3e37404f8676 100644 (file)
@@ -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");