[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:10:31 PDT 2024
llvm-ci wrote:
LLVM Buildbot has detected a new failure on builder `libc-x86_64-debian-gcc-fullbuild-dbg` running on `libc-x86_64-debian-fullbuild` while building `llvm` at step 4 "annotate".
Full details are available at: https://lab.llvm.org/buildbot/#/builders/131/builds/9115
<details>
<summary>Here is the relevant piece of the build log for the reference</summary>
```
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py ...' (failure)
...
[37/685] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/LEB128.cpp.o
[38/685] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/Locale.cpp.o
[39/685] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/FormatVariadic.cpp.o
[40/685] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/Error.cpp.o
[41/685] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/LineIterator.cpp.o
[42/685] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/HexagonAttributeParser.cpp.o
[43/685] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/InitLLVM.cpp.o
[44/685] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/FileOutputBuffer.cpp.o
[45/685] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/ARMAttributeParser.cpp.o
[46/685] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/CommandLine.cpp.o
FAILED: lib/Support/CMakeFiles/LLVMSupport.dir/CommandLine.cpp.o
/usr/bin/g++ -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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/build/lib/Support -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/llvm/lib/Support -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/build/include -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/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-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 -g -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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/llvm/lib/Support/CommandLine.cpp
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/llvm/lib/Support/CommandLine.cpp: In function ‘void ExpandBasePaths(llvm::StringRef, llvm::StringSaver&, const char*&)’:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/llvm/include/llvm/ADT/StringMapEntry.h:19,
from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/llvm/include/llvm/ADT/StringMap.h:17,
from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/llvm/include/llvm/Support/CommandLine.h:26,
from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/llvm/lib/Support/CommandLine.cpp:18:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/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) {}
| ^~~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/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 {
| ^~~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/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;
| ~~~~~~~~~~^~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/llvm/lib/Support/CommandLine.cpp:1129:33: error: call of overloaded ‘StringRef(const llvm::StringLiteral&)’ is ambiguous
1129 | TokenPos = ArgString.find(Token, StartPos)) {
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/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) {}
| ^~~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/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 {
| ^~~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/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;
| ~~~~~~~~~~^~~
[47/685] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/CodeGenCoverage.cpp.o
[48/685] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/KnownBits.cpp.o
[49/685] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/GraphWriter.cpp.o
[50/685] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/MemoryBufferRef.cpp.o
[51/685] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/ModRef.cpp.o
[52/685] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/ManagedStatic.cpp.o
[53/685] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/ELFAttributeParser.cpp.o
[54/685] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/FileUtilities.cpp.o
Step 6 (build libc) failure: build libc (failure)
...
[37/685] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/LEB128.cpp.o
[38/685] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/Locale.cpp.o
[39/685] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/FormatVariadic.cpp.o
[40/685] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/Error.cpp.o
[41/685] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/LineIterator.cpp.o
[42/685] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/HexagonAttributeParser.cpp.o
[43/685] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/InitLLVM.cpp.o
[44/685] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/FileOutputBuffer.cpp.o
[45/685] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/ARMAttributeParser.cpp.o
[46/685] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/CommandLine.cpp.o
FAILED: lib/Support/CMakeFiles/LLVMSupport.dir/CommandLine.cpp.o
/usr/bin/g++ -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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/build/lib/Support -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/llvm/lib/Support -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/build/include -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/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-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 -g -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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/llvm/lib/Support/CommandLine.cpp
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/llvm/lib/Support/CommandLine.cpp: In function ‘void ExpandBasePaths(llvm::StringRef, llvm::StringSaver&, const char*&)’:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/llvm/include/llvm/ADT/StringMapEntry.h:19,
from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/llvm/include/llvm/ADT/StringMap.h:17,
from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/llvm/include/llvm/Support/CommandLine.h:26,
from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/llvm/lib/Support/CommandLine.cpp:18:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/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) {}
| ^~~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/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 {
| ^~~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/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;
| ~~~~~~~~~~^~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/llvm/lib/Support/CommandLine.cpp:1129:33: error: call of overloaded ‘StringRef(const llvm::StringLiteral&)’ is ambiguous
1129 | TokenPos = ArgString.find(Token, StartPos)) {
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/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) {}
| ^~~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/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 {
| ^~~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/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;
| ~~~~~~~~~~^~~
[47/685] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/CodeGenCoverage.cpp.o
[48/685] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/KnownBits.cpp.o
[49/685] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/GraphWriter.cpp.o
[50/685] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/MemoryBufferRef.cpp.o
[51/685] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/ModRef.cpp.o
[52/685] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/ManagedStatic.cpp.o
[53/685] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/ELFAttributeParser.cpp.o
[54/685] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/FileUtilities.cpp.o
```
</details>
https://github.com/llvm/llvm-project/pull/113752
More information about the llvm-commits
mailing list