From 0d25d3b7e3e3acb86d93acb2291c1d26e056746b Mon Sep 17 00:00:00 2001 From: Bjorn Pettersson Date: Fri, 31 Jul 2020 14:28:49 +0200 Subject: [PATCH] [clang-tidy] Fix build problem after commit 45a720a864320bbbeb596a When building with LLVM8.0 on RHEL7.8 I got failures like this after commit 45a720a864320bbbe: /app/llvm/8.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/ 5.4.0/../../../../include/c++/5.4.0/ext/new_allocator.h:120:23: error: no matching constructor for initialization of 'std::pair, std::__cxx11::basic_string >' { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); } ... ../../clang-tools-extra/clang-tidy/ClangTidyOptions.cpp:73:15: note: in instantiation of function template specialization 'std::vector, std::__cxx11::basic_string >, std::allocator, std::__cxx11::basic_string > > >::emplace_back &>' requested here Options.emplace_back(KeyValue.getKey(), KeyValue.getValue().Value); This is an attempt to avoid such build problems. --- clang-tools-extra/clang-tidy/ClangTidyOptions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang-tools-extra/clang-tidy/ClangTidyOptions.cpp b/clang-tools-extra/clang-tidy/ClangTidyOptions.cpp index 19ba47f005dc..6b28cb2bdd13 100644 --- a/clang-tools-extra/clang-tidy/ClangTidyOptions.cpp +++ b/clang-tools-extra/clang-tidy/ClangTidyOptions.cpp @@ -70,7 +70,7 @@ struct NOptionMap { NOptionMap(IO &, const ClangTidyOptions::OptionMap &OptionMap) { Options.reserve(OptionMap.size()); for (const auto &KeyValue : OptionMap) - Options.emplace_back(KeyValue.getKey(), KeyValue.getValue().Value); + Options.emplace_back(std::string(KeyValue.getKey()), KeyValue.getValue().Value); } ClangTidyOptions::OptionMap denormalize(IO &) { ClangTidyOptions::OptionMap Map;