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 @@ -112,8 +112,8 @@ /// `e->m`, when e is a pointer, `e2->m` when e = `*e2` and `e.m` otherwise. /// Additionally, `e` is wrapped in parentheses, if needed. Stencil access(llvm::StringRef BaseId, Stencil Member); -inline Stencil access(llvm::StringRef BaseId, llvm::StringRef Member) { - return access(BaseId, text(Member)); +template Stencil access(llvm::StringRef BaseId, T &&Member) { + return access(BaseId, makeStencil(std::forward(Member))); } /// Chooses between the two stencil parts, based on whether \p ID is bound in diff --git a/clang/unittests/Tooling/StencilTest.cpp b/clang/unittests/Tooling/StencilTest.cpp --- a/clang/unittests/Tooling/StencilTest.cpp +++ b/clang/unittests/Tooling/StencilTest.cpp @@ -396,7 +396,7 @@ } TEST(StencilToStringTest, AccessOpSelector) { - auto S = access("Id", selection(name("otherId"))); + auto S = access("Id", name("otherId")); StringRef Expected = R"repr(access("Id", selection(...)))repr"; EXPECT_EQ(S->toString(), Expected); }