[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


================
@@ -208,6 +208,14 @@ NestedNameSpecifierLocBuilder(const NestedNameSpecifierLocBuilder &Other)
          BufferCapacity);
 }
 
+NestedNameSpecifierLocBuilder::NestedNameSpecifierLocBuilder(
+    NestedNameSpecifierLocBuilder &&Other)
+    : Representation(std::move(Other.Representation)), Buffer(Other.Buffer),
+      BufferSize(Other.BufferSize), BufferCapacity(Other.BufferCapacity) {
+  Other.Buffer = nullptr;
+  Other.BufferCapacity = Other.BufferSize = 0;
----------------
cor3ntin wrote:

nit: you could use std::exchange here

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


More information about the cfe-commits mailing list