[clang] [clang] Improve move-assign and move-constructor for NestedNameSpecif… (PR #180484)

Corentin Jabot via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 9 05:07:12 PST 2026


================
@@ -247,6 +255,24 @@ operator=(const NestedNameSpecifierLocBuilder &Other) {
   return *this;
 }
 
+NestedNameSpecifierLocBuilder &NestedNameSpecifierLocBuilder::operator=(
+    NestedNameSpecifierLocBuilder &&Other) {
+  Representation = std::move(Other.Representation);
+
+  // Free our storage, if we have any.
+  if (BufferCapacity) {
+    free(Buffer);
+  }
+  Buffer = Other.Buffer;
+  BufferSize = Other.BufferSize;
+  BufferCapacity = Other.BufferCapacity;
+
+  Other.Buffer = nullptr;
+  Other.BufferSize = Other.BufferCapacity = 0;
----------------
cor3ntin wrote:

ditto

https://github.com/llvm/llvm-project/pull/180484


More information about the cfe-commits mailing list