diff --git a/clang/include/clang/Tooling/Transformer/Stencil.h b/clang/include/clang/Tooling/Transformer/Stencil.h --- a/clang/include/clang/Tooling/Transformer/Stencil.h +++ b/clang/include/clang/Tooling/Transformer/Stencil.h @@ -90,6 +90,7 @@ class Stencil { public: Stencil() = default; + Stencil(std::vector Parts) : Parts(std::move(Parts)) {} /// Composes a stencil from a series of parts. template static Stencil cat(Ts &&... Parts) { @@ -140,6 +141,12 @@ template Stencil cat(Ts &&... Parts) { return Stencil::cat(std::forward(Parts)...); } +/// Convenience wrapper for Stencil constructor of the same type. Declaration +/// outside of the class supports transition of `Stencil` type to an alias +/// rather than a class. +inline Stencil catVector(std::vector Parts) { + return Stencil(std::move(Parts)); +} /// \returns exactly the text provided. StencilPart text(llvm::StringRef Text);