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


llvm-ci wrote:

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

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

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

```
Step 5 (build) failure: 'ninja' (failure)
...
[29/3580] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/CSKYAttributeParser.cpp.o
[30/3580] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/DataExtractor.cpp.o
[31/3580] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/Debug.cpp.o
[32/3580] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/DebugCounter.cpp.o
[33/3580] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/DAGDeltaAlgorithm.cpp.o
[34/3580] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/DJB.cpp.o
[35/3580] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/DynamicAPInt.cpp.o
[36/3580] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/ELFAttributes.cpp.o
[37/3580] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/Error.cpp.o
[38/3580] 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_DEBUG -D_GLIBCXX_ASSERTIONS -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 -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/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;
      |                               ~~~~~~~~~~^~~
[39/3580] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/ErrorHandling.cpp.o
[40/3580] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/ExponentialBackoff.cpp.o
[41/3580] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/ELFAttributeParser.cpp.o
[42/3580] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/FileCollector.cpp.o

```

</details>

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


More information about the llvm-commits mailing list