[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:08:50 PDT 2024


llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `openmp-s390x-linux` running on `systemz-1` while building `llvm` at step 5 "compile-openmp".

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

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

```
Step 5 (compile-openmp) failure: build (failure)
...
7.427 [5136/4/32] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/Chrono.cpp.o
7.446 [5135/4/33] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/CRC.cpp.o
7.460 [5134/4/34] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/ConvertUTF.cpp.o
8.080 [5133/4/35] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/ConvertEBCDIC.cpp.o
8.266 [5132/4/36] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/Compression.cpp.o
8.275 [5131/4/37] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/CodeGenCoverage.cpp.o
8.283 [5130/4/38] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/CrashRecoveryContext.cpp.o
8.877 [5129/4/39] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/CSKYAttributes.cpp.o
8.889 [5128/4/40] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/ConvertUTFWrapper.cpp.o
8.958 [5127/4/41] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/CommandLine.cpp.o
FAILED: lib/Support/CMakeFiles/LLVMSupport.dir/CommandLine.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes /usr/bin/ccache /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 -I/home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.build/lib/Support -I/home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.src/llvm/lib/Support -I/home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.build/include -I/home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.src/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 -Wctad-maybe-unsupported -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 /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.src/llvm/lib/Support/CommandLine.cpp
/home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.src/llvm/lib/Support/CommandLine.cpp: In function 'void ExpandBasePaths(llvm::StringRef, llvm::StringSaver&, const char*&)':
/home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.src/llvm/lib/Support/CommandLine.cpp:1127:54: error: call of overloaded 'StringRef(const llvm::StringLiteral&)' is ambiguous
 1127 |   for (StringRef::size_type TokenPos = ArgString.find(Token);
      |                                        ~~~~~~~~~~~~~~^~~~~~~
In file included from /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.src/llvm/include/llvm/ADT/StringMapEntry.h:19,
                 from /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.src/llvm/include/llvm/ADT/StringMap.h:17,
                 from /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.src/llvm/include/llvm/Support/CommandLine.h:26,
                 from /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.src/llvm/lib/Support/CommandLine.cpp:18:
/home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.src/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) {}
      |                            ^~~~~~~~~
/home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.src/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 {
      |                          ^~~~~~~~~
/home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.src/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;
      |                               ~~~~~~~~~~^~~
/home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.src/llvm/lib/Support/CommandLine.cpp:1129:33: error: call of overloaded 'StringRef(const llvm::StringLiteral&)' is ambiguous
 1129 |        TokenPos = ArgString.find(Token, StartPos)) {
      |                   ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
In file included from /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.src/llvm/include/llvm/ADT/StringMapEntry.h:19,
                 from /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.src/llvm/include/llvm/ADT/StringMap.h:17,
                 from /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.src/llvm/include/llvm/Support/CommandLine.h:26,
                 from /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.src/llvm/lib/Support/CommandLine.cpp:18:
/home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.src/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) {}
      |                            ^~~~~~~~~
/home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.src/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 {
      |                          ^~~~~~~~~
/home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.src/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;
      |                               ~~~~~~~~~~^~~
9.251 [5127/3/42] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/CSKYAttributeParser.cpp.o
9.966 [5127/2/43] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/Debug.cpp.o
10.004 [5127/1/44] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/DataExtractor.cpp.o
ninja: build stopped: subcommand failed.

```

</details>

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


More information about the llvm-commits mailing list