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


llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `lldb-remote-linux-ubuntu` running on `as-builder-9` while building `llvm` at step 7 "build-default".

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

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

```
Step 7 (build-default) failure: cmake (failure)
...
4.170 [5003/66/75] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/RISCVAttributes.cpp.o
4.186 [5002/66/76] Building C object lib/Support/CMakeFiles/LLVMSupport.dir/regcomp.c.o
4.205 [5001/66/77] Building C object lib/Support/CMakeFiles/LLVMSupport.dir/regerror.c.o
4.217 [5000/66/78] Building C object lib/Support/CMakeFiles/LLVMSupport.dir/regexec.c.o
4.226 [4999/66/79] Building C object lib/Support/CMakeFiles/LLVMSupport.dir/regfree.c.o
4.234 [4998/66/80] Building C object lib/Support/CMakeFiles/LLVMSupport.dir/regstrlcpy.c.o
4.242 [4997/66/81] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/GraphWriter.cpp.o
4.294 [4996/66/82] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/RewriteBuffer.cpp.o
4.302 [4995/66/83] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/Atomic.cpp.o
4.329 [4994/66/84] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/JSON.cpp.o
FAILED: lib/Support/CMakeFiles/LLVMSupport.dir/JSON.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/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/lib/Support -I/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/llvm/lib/Support -I/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/include -I/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/llvm/include -D__OPTIMIZE__ -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-maybe-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 -UNDEBUG  -fno-exceptions -funwind-tables -fno-rtti -MD -MT lib/Support/CMakeFiles/LLVMSupport.dir/JSON.cpp.o -MF lib/Support/CMakeFiles/LLVMSupport.dir/JSON.cpp.o.d -o lib/Support/CMakeFiles/LLVMSupport.dir/JSON.cpp.o -c /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/llvm/lib/Support/JSON.cpp
/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/llvm/lib/Support/JSON.cpp: In member function ‘llvm::Error llvm::json::Path::Root::getError() const’:
/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/llvm/lib/Support/JSON.cpp:229:6: error: ambiguous overload for ‘operator<<’ (operand types are ‘llvm::raw_string_ostream’ and ‘const llvm::StringLiteral’)
  229 |   OS << (ErrorMessage.empty() ? "invalid JSON contents" : ErrorMessage);
      |   ~~ ^~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |   |                           |
      |   llvm::raw_string_ostream    const llvm::StringLiteral
In file included from /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/llvm/include/llvm/Support/Error.h:25,
                 from /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/llvm/include/llvm/Support/JSON.h:54,
                 from /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/llvm/lib/Support/JSON.cpp:9:
/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/llvm/include/llvm/Support/raw_ostream.h:224:16: note: candidate: ‘llvm::raw_ostream& llvm::raw_ostream::operator<<(llvm::StringRef)’
  224 |   raw_ostream &operator<<(StringRef Str) {
      |                ^~~~~~~~
/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/llvm/include/llvm/Support/raw_ostream.h:265:16: note: candidate: ‘llvm::raw_ostream& llvm::raw_ostream::operator<<(const std::string_view&)’
  265 |   raw_ostream &operator<<(const std::string_view &Str) {
      |                ^~~~~~~~
/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/llvm/include/llvm/Support/JSON.h:1089:27: note: candidate: ‘llvm::raw_ostream& llvm::json::operator<<(llvm::raw_ostream&, const Value&)’
 1089 | inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, const Value &V) {
      |                           ^~~~~~~~
In file included from /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/llvm/include/llvm/Support/Error.h:17:
/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/llvm/include/llvm/ADT/Twine.h:572:23: note: candidate: ‘llvm::raw_ostream& llvm::operator<<(raw_ostream&, const Twine&)’
  572 |   inline raw_ostream &operator<<(raw_ostream &OS, const Twine &RHS) {
      |                       ^~~~~~~~
4.361 [4994/65/85] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/RewriteRope.cpp.o
4.372 [4994/64/86] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/PrettyStackTrace.cpp.o
4.470 [4994/63/87] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/PluginLoader.cpp.o
4.562 [4994/62/88] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/RISCVISAUtils.cpp.o
4.597 [4994/61/89] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/CachePruning.cpp.o
4.618 [4994/60/90] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/Error.cpp.o
4.619 [4994/59/91] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/SystemUtils.cpp.o
4.668 [4994/58/92] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/SHA1.cpp.o
4.716 [4994/57/93] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/Regex.cpp.o
4.768 [4994/56/94] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/SipHash.cpp.o
4.775 [4994/55/95] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/SmallVector.cpp.o
4.832 [4994/54/96] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/PGOOptions.cpp.o
4.840 [4994/53/97] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/FileCollector.cpp.o
4.846 [4994/52/98] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/StringMap.cpp.o
4.853 [4994/51/99] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/CodeGenCoverage.cpp.o

```

</details>

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


More information about the llvm-commits mailing list