[llvm] [ADT] Teach StringRef to derive from std::string_view (PR #113752)

LLVM Continuous Integration via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 26 10:06:14 PDT 2024


llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `arc-builder` running on `arc-worker` while building `llvm` at step 5 "build-unified-tree".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/3/builds/6715

<details>
<summary>Here is the relevant piece of the build log for the reference</summary>

```
Step 5 (build-unified-tree) failure: build (failure)
...
3.086 [3646/16/17] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/ARMAttributeParser.cpp.o
3.132 [3645/16/18] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/APFixedPoint.cpp.o
3.219 [3644/16/19] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/ConvertUTFWrapper.cpp.o
3.502 [3643/16/20] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/CachePruning.cpp.o
3.710 [3642/16/21] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/Caching.cpp.o
3.725 [3641/16/22] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/CSKYAttributeParser.cpp.o
3.844 [3640/16/23] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/CodeGenCoverage.cpp.o
3.936 [3639/16/24] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/DJB.cpp.o
4.107 [3638/16/25] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/DynamicAPInt.cpp.o
4.118 [3637/16/26] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/CommandLine.cpp.o
FAILED: lib/Support/CMakeFiles/LLVMSupport.dir/CommandLine.cpp.o 
/usr/bin/c++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib/Support -I/buildbot/worker/arc-folder/llvm-project/llvm/lib/Support -Iinclude -I/buildbot/worker/arc-folder/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -UNDEBUG -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -MD -MT lib/Support/CMakeFiles/LLVMSupport.dir/CommandLine.cpp.o -MF lib/Support/CMakeFiles/LLVMSupport.dir/CommandLine.cpp.o.d -o lib/Support/CMakeFiles/LLVMSupport.dir/CommandLine.cpp.o -c /buildbot/worker/arc-folder/llvm-project/llvm/lib/Support/CommandLine.cpp
/buildbot/worker/arc-folder/llvm-project/llvm/lib/Support/CommandLine.cpp: In function 'void ExpandBasePaths(llvm::StringRef, llvm::StringSaver&, const char*&)':
/buildbot/worker/arc-folder/llvm-project/llvm/lib/Support/CommandLine.cpp:1127:60: error: call of overloaded 'StringRef(const llvm::StringLiteral&)' is ambiguous
 1127 |   for (StringRef::size_type TokenPos = ArgString.find(Token);
      |                                                            ^
In file included from /buildbot/worker/arc-folder/llvm-project/llvm/include/llvm/ADT/StringMapEntry.h:19,
                 from /buildbot/worker/arc-folder/llvm-project/llvm/include/llvm/ADT/StringMap.h:17,
                 from /buildbot/worker/arc-folder/llvm-project/llvm/include/llvm/Support/CommandLine.h:26,
                 from /buildbot/worker/arc-folder/llvm-project/llvm/lib/Support/CommandLine.cpp:18:
/buildbot/worker/arc-folder/llvm-project/llvm/include/llvm/ADT/StringRef.h:103:28: note: candidate: 'constexpr llvm::StringRef::StringRef(std::string_view)'
  103 |     /*implicit*/ constexpr StringRef(std::string_view Str) : Base(Str) {}
      |                            ^~~~~~~~~
/buildbot/worker/arc-folder/llvm-project/llvm/include/llvm/ADT/StringRef.h:51:26: note: candidate: 'constexpr llvm::StringRef::StringRef(const llvm::StringRef&)'
   51 |   class LLVM_GSL_POINTER StringRef : public std::string_view {
      |                          ^~~~~~~~~
/buildbot/worker/arc-folder/llvm-project/llvm/include/llvm/ADT/StringRef.h:313:41: note:   initializing argument 1 of 'size_t llvm::StringRef::find(llvm::StringRef, size_t) const'
  313 |     [[nodiscard]] size_t find(StringRef Str, size_t From = 0) const;
      |                               ~~~~~~~~~~^~~
/buildbot/worker/arc-folder/llvm-project/llvm/lib/Support/CommandLine.cpp:1129:49: error: call of overloaded 'StringRef(const llvm::StringLiteral&)' is ambiguous
 1129 |        TokenPos = ArgString.find(Token, StartPos)) {
      |                                                 ^
In file included from /buildbot/worker/arc-folder/llvm-project/llvm/include/llvm/ADT/StringMapEntry.h:19,
                 from /buildbot/worker/arc-folder/llvm-project/llvm/include/llvm/ADT/StringMap.h:17,
                 from /buildbot/worker/arc-folder/llvm-project/llvm/include/llvm/Support/CommandLine.h:26,
                 from /buildbot/worker/arc-folder/llvm-project/llvm/lib/Support/CommandLine.cpp:18:
/buildbot/worker/arc-folder/llvm-project/llvm/include/llvm/ADT/StringRef.h:103:28: note: candidate: 'constexpr llvm::StringRef::StringRef(std::string_view)'
  103 |     /*implicit*/ constexpr StringRef(std::string_view Str) : Base(Str) {}
      |                            ^~~~~~~~~
/buildbot/worker/arc-folder/llvm-project/llvm/include/llvm/ADT/StringRef.h:51:26: note: candidate: 'constexpr llvm::StringRef::StringRef(const llvm::StringRef&)'
   51 |   class LLVM_GSL_POINTER StringRef : public std::string_view {
      |                          ^~~~~~~~~
/buildbot/worker/arc-folder/llvm-project/llvm/include/llvm/ADT/StringRef.h:313:41: note:   initializing argument 1 of 'size_t llvm::StringRef::find(llvm::StringRef, size_t) const'
  313 |     [[nodiscard]] size_t find(StringRef Str, size_t From = 0) const;
      |                               ~~~~~~~~~~^~~
4.203 [3637/15/27] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/ELFAttributes.cpp.o
4.421 [3637/14/28] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/DataExtractor.cpp.o
4.571 [3637/13/29] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/Debug.cpp.o
4.646 [3637/12/30] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/APInt.cpp.o

```

</details>

https://github.com/llvm/llvm-project/pull/113752


More information about the llvm-commits mailing list