From 51139f6b1fab7e952c1d845466189f21bafdc517 Mon Sep 17 00:00:00 2001 From: Frank Mayer Date: Fri, 27 Mar 2026 20:29:27 +0100 Subject: [PATCH] Fix StringRef build with newer libc++ format code --- include/llvm/ADT/StringRef.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/include/llvm/ADT/StringRef.h b/include/llvm/ADT/StringRef.h index c103fdbf3b..df58c78b53 100644 --- a/include/llvm/ADT/StringRef.h +++ b/include/llvm/ADT/StringRef.h @@ -571,9 +571,12 @@ namespace llvm { } // HLSL Change Starts -// StringRef provides an operator string; that trips up the std::pair noexcept specification, -// which (a) enables the moves constructor (because conversion is allowed), but (b) -// misclassifies the the construction as nothrow. +// StringRef provides an operator string; that trips up the std::pair noexcept +// specification, which (a) enables the moves constructor (because conversion is +// allowed), but (b) misclassifies the the construction as nothrow. Newer libc++ +// releases reject user specializations of this trait outright, and also compute +// the trait correctly without help. +#if !defined(_LIBCPP_VERSION) namespace std { template<> struct is_nothrow_constructible @@ -588,6 +591,7 @@ namespace std { : std::false_type { }; } +#endif // HLSL Change Ends #endif