diff --git a/llvm/include/llvm/ADT/GenericUniformityImpl.h b/llvm/include/llvm/ADT/GenericUniformityImpl.h --- a/llvm/include/llvm/ADT/GenericUniformityImpl.h +++ b/llvm/include/llvm/ADT/GenericUniformityImpl.h @@ -468,8 +468,9 @@ }; template -void GenericUniformityInfo::ImplDeleter::operator()( - GenericUniformityAnalysisImpl *Impl) { +template +void GenericUniformityInfo::ImplDeleter::operator()( + DelT *Impl) { delete Impl; } diff --git a/llvm/include/llvm/ADT/GenericUniformityInfo.h b/llvm/include/llvm/ADT/GenericUniformityInfo.h --- a/llvm/include/llvm/ADT/GenericUniformityInfo.h +++ b/llvm/include/llvm/ADT/GenericUniformityInfo.h @@ -63,12 +63,16 @@ private: using ImplT = GenericUniformityAnalysisImpl; - struct ImplDeleter { - void operator()(GenericUniformityAnalysisImpl *Impl); + // Ugly hack around the fact that recent (> 15.0) clang will run into an + // is_invocable() check in some GNU libc++'s unique_ptr implementation + // and reject this deleter if you just make it callable with an ImplT *, + // whether or not the type of ImplT is spelled out. + template struct ImplDeleter { + void operator()(DelT *Impl); }; FunctionT *F; - std::unique_ptr DA; + std::unique_ptr> DA; GenericUniformityInfo(const GenericUniformityInfo &) = delete; GenericUniformityInfo &operator=(const GenericUniformityInfo &) = delete;