[PATCH] D69959: [C-index] Fix test when using Debug target & MSVC STL

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 12 15:29:11 PST 2019


rnk added a subscriber: dblaikie.
rnk added a comment.

For reference, this is the code sequence that needs the SmallVector change:
https://github.com/llvm/llvm-project/blob/99e2cba219aea80b3f11de2aa4e0192b28852de4/clang/lib/Frontend/CompilerInvocation.cpp#L1872



================
Comment at: clang-tools-extra/clang-move/tool/ClangMove.cpp:113
   move::MoveDefinitionSpec Spec;
-  Spec.Names = {Names.begin(), Names.end()};
+  Spec.Names = (std::vector<std::string> &)Names;
   Spec.OldHeader = OldHeader;
----------------
Converting from std::list to SmallVector by way of std::vector with a C-style cast is a bit surprising. Is there a simpler way to write this, like `Spec.Names.assign(Names.begin(), Names.end());`?


================
Comment at: llvm/include/llvm/ADT/SmallVector.h:905
+
+  const SmallVector &operator=(const std::vector<T> &Vec) {
+    this->assign(Vec.begin(), Vec.end());
----------------
+ at dblaikie, who knows more about STL container details than I do.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69959/new/

https://reviews.llvm.org/D69959





More information about the cfe-commits mailing list