diff --git a/llvm/include/llvm/ADT/ilist_node.h b/llvm/include/llvm/ADT/ilist_node.h index bfd50f8b3fb71..67384546a9275 100644 --- a/llvm/include/llvm/ADT/ilist_node.h +++ b/llvm/include/llvm/ADT/ilist_node.h @@ -18,6 +18,8 @@ #include "llvm/ADT/ilist_node_base.h" #include "llvm/ADT/ilist_node_options.h" +#include + namespace llvm { namespace ilist_detail { @@ -147,9 +149,13 @@ class ilist_node_impl /// /// This requires sentinel tracking to be explicitly enabled. Use the /// ilist_sentinel_tracking option to get this API. - bool isSentinel() const { - static_assert(OptionsT::is_sentinel_tracking_explicit, - "Use ilist_sentinel_tracking to enable isSentinel()"); + /// + /// Rather than using static_assert to enforce the API is not called when + /// configured with is_sentinel_tracking_explicit=false, the method is + /// conditionally provided using std::enable_if. This way, clients of + /// ilist_node_impl can be fully instantiated for DLLExport on Windows. + template + std::enable_if_t isSentinel() const { return node_base_type::isSentinel(); } };