diff --git a/clang-tools-extra/clangd/ConfigProvider.cpp b/clang-tools-extra/clangd/ConfigProvider.cpp --- a/clang-tools-extra/clangd/ConfigProvider.cpp +++ b/clang-tools-extra/clangd/ConfigProvider.cpp @@ -144,7 +144,7 @@ std::unique_ptr Provider::combine(std::vector Providers) { - struct CombinedProvider : Provider { + class CombinedProvider : public Provider { std::vector Providers; std::vector @@ -156,14 +156,13 @@ } return Result; } + + public: + CombinedProvider(std::vector Providers) + : Providers(std::move(Providers)) {} }; - auto Result = std::make_unique(); - Result->Providers = std::move(Providers); - // FIXME: This is a workaround for a bug in older versions of clang (< 3.9) - // The constructor that is supposed to allow for Derived to Base - // conversion does not work. Remove this if we drop support for such - // configurations. - return std::unique_ptr(Result.release()); + + return std::make_unique(std::move(Providers)); } Config Provider::getConfig(const Params &P, DiagnosticCallback DC) const {