Skip to content

Commit 51139f6

Browse files
committed
Fix StringRef build with newer libc++
format code
1 parent 67a8e24 commit 51139f6

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

include/llvm/ADT/StringRef.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -571,9 +571,12 @@ namespace llvm {
571571
}
572572

573573
// HLSL Change Starts
574-
// StringRef provides an operator string; that trips up the std::pair noexcept specification,
575-
// which (a) enables the moves constructor (because conversion is allowed), but (b)
576-
// misclassifies the the construction as nothrow.
574+
// StringRef provides an operator string; that trips up the std::pair noexcept
575+
// specification, which (a) enables the moves constructor (because conversion is
576+
// allowed), but (b) misclassifies the the construction as nothrow. Newer libc++
577+
// releases reject user specializations of this trait outright, and also compute
578+
// the trait correctly without help.
579+
#if !defined(_LIBCPP_VERSION)
577580
namespace std {
578581
template<>
579582
struct is_nothrow_constructible <std::string, llvm::StringRef>
@@ -588,6 +591,7 @@ namespace std {
588591
: std::false_type {
589592
};
590593
}
594+
#endif
591595
// HLSL Change Ends
592596

593597
#endif

0 commit comments

Comments
 (0)