From af1bb4bc823f823df9869d354f639ee86b83d747 Mon Sep 17 00:00:00 2001 From: Nathan James Date: Wed, 13 Jan 2021 12:19:42 +0000 Subject: [PATCH] Fix build errors after ceb9379a9 For some reason some builds dont like the arrow operator access. using the deref then access should fix the issue. /home/buildbots/ppc64le-flang-mlir-rhel-test/ppc64le-flang-rhel-clang-build/llvm-project/llvm/include/llvm/ADT/iterator.h:171:34: error: taking the address of a temporary object of type 'llvm::StringRef' [-Waddress-of-temporary] PointerT operator->() { return &static_cast(this)->operator*(); } ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/buildbots/ppc64le-flang-mlir-rhel-test/ppc64le-flang-rhel-clang-build/llvm-project/llvm/include/llvm/ADT/StringExtras.h:387:13: note: in instantiation of member function 'llvm::iterator_facade_base, std::random_access_iterator_tag, llvm::StringRef, long, llvm::StringRef *, llvm::StringRef &>::operator->' requested here Len += I->size(); --- llvm/include/llvm/ADT/StringExtras.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/include/llvm/ADT/StringExtras.h b/llvm/include/llvm/ADT/StringExtras.h index 0178539bc402..caa1ed547bb2 100644 --- a/llvm/include/llvm/ADT/StringExtras.h +++ b/llvm/include/llvm/ADT/StringExtras.h @@ -384,7 +384,7 @@ inline std::string join_impl(IteratorT Begin, IteratorT End, size_t Len = (std::distance(Begin, End) - 1) * Separator.size(); for (IteratorT I = Begin; I != End; ++I) - Len += I->size(); + Len += (*I).size(); S.reserve(Len); size_t PrevCapacity = S.capacity(); (void)PrevCapacity;