Default initialize from explicitly constructed object.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@244596 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Manuel Klimek 2015-08-11 12:13:15 +00:00
Родитель 77e6340d16
Коммит bbdbc223ff
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -48,7 +48,8 @@ runCheckOnCode(StringRef Code, std::vector<ClangTidyError> *Errors = nullptr,
const Twine &Filename = "input.cc",
ArrayRef<std::string> ExtraArgs = None,
const ClangTidyOptions &ExtraOptions = ClangTidyOptions(),
std::map<StringRef, StringRef> PathsToContent = {}) {
std::map<StringRef, StringRef> PathsToContent =
std::map<StringRef, StringRef>()) {
ClangTidyOptions Options = ExtraOptions;
Options.Checks = "*";
ClangTidyContext Context(llvm::make_unique<DefaultOptionsProvider>(
@ -70,7 +71,7 @@ runCheckOnCode(StringRef Code, std::vector<ClangTidyError> *Errors = nullptr,
tooling::ToolInvocation Invocation(
ArgCXX11, new TestClangTidyAction(Check, Finder, Context), Files.get());
Invocation.mapVirtualFile(Filename.str(), Code);
for (const auto & FileContent : PathsToContent) {
for (const auto &FileContent : PathsToContent) {
Invocation.mapVirtualFile(Twine("include/" + FileContent.first).str(),
FileContent.second);
}