[libc-commits] [libc] [libc] Template the writing mode for the writer class (PR #111559)
via libc-commits
libc-commits at lists.llvm.org
Thu Mar 13 11:03:01 PDT 2025
PiJoules wrote:
It looks like this broke our builders at https://ci.chromium.org/ui/p/fuchsia/builders/toolchain.ci/clang-linux-x64/b8720577119613178561/overview
```
[706/2837](61) Building CXX object libc/src/stdio/baremetal/CMakeFiles/libc.src.stdio.baremetal.printf.dir/printf.cpp.obj
FAILED: libc/src/stdio/baremetal/CMakeFiles/libc.src.stdio.baremetal.printf.dir/printf.cpp.obj
/b/s/w/ir/x/w/llvm_build/./bin/clang++ --target=armv6m-none-eabi -DLIBC_NAMESPACE=__llvm_libc_21_0_0_git -I/b/s/w/ir/x/w/llvm-llvm-project/libc -isystem /b/s/w/ir/x/w/llvm_build/include/armv6m-unknown-none-eabi --target=armv6m-none-eabi -Wno-atomic-alignment "-Dvfprintf(stream, format, vlist)=vprintf(format, vlist)" "-Dfprintf(stream, format, ...)=printf(format)" -D_LIBCPP_PRINT=1 -mthumb -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -ffunction-sections -fdata-sections -ffile-prefix-map=/b/s/w/ir/x/w/llvm_build/runtimes/runtimes-armv6m-none-eabi-bins=../../../llvm-llvm-project -ffile-prefix-map=/b/s/w/ir/x/w/llvm-llvm-project/= -no-canonical-prefixes -Os -DNDEBUG -std=gnu++17 --target=armv6m-none-eabi -DLIBC_QSORT_IMPL=LIBC_QSORT_HEAP_SORT -DLIBC_TYPES_TIME_T_IS_32_BIT -DLIBC_ADD_NULL_CHECKS "-DLIBC_MATH=(LIBC_MATH_SKIP_ACCURATE_PASS | LIBC_MATH_SMALL_TABLES)" -fpie -ffreestanding -DLIBC_FULL_BUILD -nostdlibinc -ffixed-point -fno-builtin -fno-exceptions -fno-lax-vector-conversions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ftrivial-auto-var-init=pattern -fno-omit-frame-pointer -Wall -Wextra -Werror -Wconversion -Wno-sign-conversion -Wdeprecated -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wstrict-prototypes -Wthread-safety -Wglobal-constructors -DLIBC_COPT_PUBLIC_PACKAGING -UNDEBUG -DLIBC_COPT_PRINTF_DISABLE_FLOAT -DLIBC_COPT_PRINTF_DISABLE_INDEX_MODE -DLIBC_COPT_PRINTF_DISABLE_WRITE_INT -DLIBC_COPT_PRINTF_DISABLE_FIXED_POINT -DLIBC_COPT_PRINTF_DISABLE_STRERROR -DLIBC_COPT_PRINTF_RUNTIME_DISPATCH -MD -MT libc/src/stdio/baremetal/CMakeFiles/libc.src.stdio.baremetal.printf.dir/printf.cpp.obj -MF libc/src/stdio/baremetal/CMakeFiles/libc.src.stdio.baremetal.printf.dir/printf.cpp.obj.d -o libc/src/stdio/baremetal/CMakeFiles/libc.src.stdio.baremetal.printf.dir/printf.cpp.obj -c /b/s/w/ir/x/w/llvm-llvm-project/libc/src/stdio/baremetal/printf.cpp
/b/s/w/ir/x/w/llvm-llvm-project/libc/src/stdio/baremetal/printf.cpp:41:28: error: no viable constructor or deduction guide for deduction of template arguments of 'printf_core::WriteBuffer'
41 | printf_core::WriteBuffer wb(buffer, BUFF_SIZE, &raw_write_hook, nullptr);
| ^
/b/s/w/ir/x/w/llvm-llvm-project/libc/src/stdio/printf_core/writer.h:57:15: note: candidate template ignored: couldn't infer template argument 'write_mode'
57 | LIBC_INLINE WriteBuffer(char *buff, size_t buff_len, StreamWriter hook,
| ^
/b/s/w/ir/x/w/llvm-llvm-project/libc/src/stdio/printf_core/writer.h:57:15: note: implicit deduction guide declared as 'template <WriteMode write_mode> WriteBuffer(char *buff, size_t buff_len, StreamWriter hook, void *target) -> WriteBuffer<write_mode>'
/b/s/w/ir/x/w/llvm-llvm-project/libc/src/stdio/printf_core/writer.h:67:15: note: candidate function template not viable: requires 3 arguments, but 4 were provided
67 | LIBC_INLINE WriteBuffer(char *buff, size_t buff_len, StreamWriter hook)
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/b/s/w/ir/x/w/llvm-llvm-project/libc/src/stdio/printf_core/writer.h:67:15: note: implicit deduction guide declared as 'template <WriteMode write_mode> WriteBuffer(char *buff, size_t buff_len, StreamWriter hook) -> WriteBuffer<write_mode>'
/b/s/w/ir/x/w/llvm-llvm-project/libc/src/stdio/printf_core/writer.h:62:15: note: candidate function template not viable: requires 2 arguments, but 4 were provided
62 | LIBC_INLINE WriteBuffer(char *buff, size_t buff_len)
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
/b/s/w/ir/x/w/llvm-llvm-project/libc/src/stdio/printf_core/writer.h:62:15: note: implicit deduction guide declared as 'template <WriteMode write_mode> WriteBuffer(char *buff, size_t buff_len) -> WriteBuffer<write_mode>'
/b/s/w/ir/x/w/llvm-llvm-project/libc/src/stdio/printf_core/writer.h:41:40: note: candidate function template not viable: requires 1 argument, but 4 were provided
41 | template <WriteMode write_mode> struct WriteBuffer {
| ^~~~~~~~~~~
/b/s/w/ir/x/w/llvm-llvm-project/libc/src/stdio/printf_core/writer.h:41:40: note: implicit deduction guide declared as 'template <WriteMode write_mode> WriteBuffer(WriteBuffer<write_mode>) -> WriteBuffer<write_mode>'
1 error generated.
```
Would you be able to take a look and send out a fix or revert? Thanks.
https://github.com/llvm/llvm-project/pull/111559
More information about the libc-commits
mailing list