[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:05:12 PDT 2024


llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `polly-x86_64-linux-noassert` running on `polly-x86_64-gce1` while building `llvm` at step 5 "build".

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

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

```
Step 5 (build) failure: 'ninja' (failure)
...
[20/3578] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/Caching.cpp.o
[21/3578] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/Chrono.cpp.o
[22/3578] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/BalancedPartitioning.cpp.o
[23/3578] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/ConvertEBCDIC.cpp.o
[24/3578] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/VirtualFileSystem.cpp.o
[25/3578] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/Compression.cpp.o
[26/3578] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/ConvertUTFWrapper.cpp.o
[27/3578] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/CodeGenCoverage.cpp.o
[28/3578] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/CSKYAttributes.cpp.o
[29/3578] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/CommandLine.cpp.o
FAILED: lib/Support/CMakeFiles/LLVMSupport.dir/CommandLine.cpp.o 
ccache /usr/bin/c++ -DGTEST_HAS_RTTI=0 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/worker/buildbot-workers/polly-x86_64-gce1/rundir/llvm.obj/lib/Support -I/home/worker/buildbot-workers/polly-x86_64-gce1/rundir/llvm.src/llvm/lib/Support -I/home/worker/buildbot-workers/polly-x86_64-gce1/rundir/llvm.obj/include -I/home/worker/buildbot-workers/polly-x86_64-gce1/rundir/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 -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/worker/buildbot-workers/polly-x86_64-gce1/rundir/llvm.src/llvm/lib/Support/CommandLine.cpp
/home/worker/buildbot-workers/polly-x86_64-gce1/rundir/llvm.src/llvm/lib/Support/CommandLine.cpp: In function ‘void ExpandBasePaths(llvm::StringRef, llvm::StringSaver&, const char*&)’:
/home/worker/buildbot-workers/polly-x86_64-gce1/rundir/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/worker/buildbot-workers/polly-x86_64-gce1/rundir/llvm.src/llvm/include/llvm/ADT/StringMapEntry.h:19,
                 from /home/worker/buildbot-workers/polly-x86_64-gce1/rundir/llvm.src/llvm/include/llvm/ADT/StringMap.h:17,
                 from /home/worker/buildbot-workers/polly-x86_64-gce1/rundir/llvm.src/llvm/include/llvm/Support/CommandLine.h:26,
                 from /home/worker/buildbot-workers/polly-x86_64-gce1/rundir/llvm.src/llvm/lib/Support/CommandLine.cpp:18:
/home/worker/buildbot-workers/polly-x86_64-gce1/rundir/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/worker/buildbot-workers/polly-x86_64-gce1/rundir/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/worker/buildbot-workers/polly-x86_64-gce1/rundir/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/worker/buildbot-workers/polly-x86_64-gce1/rundir/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/worker/buildbot-workers/polly-x86_64-gce1/rundir/llvm.src/llvm/include/llvm/ADT/StringMapEntry.h:19,
                 from /home/worker/buildbot-workers/polly-x86_64-gce1/rundir/llvm.src/llvm/include/llvm/ADT/StringMap.h:17,
                 from /home/worker/buildbot-workers/polly-x86_64-gce1/rundir/llvm.src/llvm/include/llvm/Support/CommandLine.h:26,
                 from /home/worker/buildbot-workers/polly-x86_64-gce1/rundir/llvm.src/llvm/lib/Support/CommandLine.cpp:18:
/home/worker/buildbot-workers/polly-x86_64-gce1/rundir/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/worker/buildbot-workers/polly-x86_64-gce1/rundir/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/worker/buildbot-workers/polly-x86_64-gce1/rundir/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;
      |                               ~~~~~~~~~~^~~
[30/3578] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/CSKYAttributeParser.cpp.o
[31/3578] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/Debug.cpp.o
[32/3578] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/DataExtractor.cpp.o
[33/3578] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/DAGDeltaAlgorithm.cpp.o

```

</details>

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


More information about the llvm-commits mailing list