abseil/abseil-cpp

mismatched types ‘absl::lts_2020_09_23::FormatSpec<Args ...>’ and ‘const char [34]’

Closed this issue · 1 comments

Describe the issue

It can not work when run make?

/home/www/demoC/sshCSpireClient/grpc/grpc/test/core/end2end/cq_verifier.cc: 在函数‘std::string {anonymous}::ExpectationString(const Expectation&)’中:
/home/www/demoC/sshCSpireClient/grpc/grpc/test/core/end2end/cq_verifier.cc:203:54: 错误:对‘StrAppendFormat(std::string*, const char [34], const int&, const char* const&, const int&)’的调用没有匹配的函数
                             e.success, e.file, e.line);
                                                      ^
/home/www/demoC/sshCSpireClient/grpc/grpc/test/core/end2end/cq_verifier.cc:203:54: 附注:备选是:
In file included from /home/www/demoC/sshCSpireClient/grpc/grpc/test/core/end2end/cq_verifier.cc:30:0:
/home/www/demoC/sshCSpireClient/grpc/grpc/third_party/abseil-cpp/absl/strings/str_format.h:357:14: 附注:template<class ... Args> std::string& absl::lts_2020_09_23::StrAppendFormat(std::string*, absl::lts_2020_09_23::FormatSpec<Args ...>&, const Args& ...)
 std::string& StrAppendFormat(std::string* dst,
              ^
/home/www/demoC/sshCSpireClient/grpc/grpc/third_party/abseil-cpp/absl/strings/str_format.h:357:14: 附注:  template argument deduction/substitution failed:
/home/www/demoC/sshCSpireClient/grpc/grpc/test/core/end2end/cq_verifier.cc:203:54: 附注:  mismatched types ‘absl::lts_2020_09_23::FormatSpec<Args ...>’ and ‘const char [34]’
                             e.success, e.file, e.line);
                                                      ^
make[2]: *** [CMakeFiles/unknown_frame_bad_client_test.dir/build.make:89:CMakeFiles/unknown_frame_bad_client_test.dir/test/core/end2end/cq_verifier.cc.o] 错误 1
make[1]: *** [CMakeFiles/Makefile2:2331:CMakeFiles/unknown_frame_bad_client_test.dir/all] 错误 2
make[1]: *** 正在等待未完成的任务....

Steps to reproduce the problem

GRPC_VERSION=1.34.0
cd /tmp && git clone --recurse-submodules -b v${GRPC_VERSION} https://github.com/grpc/grpc
cd /tmp/grpc/cmake/build && cmake -DgRPC_INSTALL=ON -DgRPC_BUILD_TESTS=ON ../..
sed -i '7,13d' /tmp/grpc/third_party/benchmark/test/cxx03_test.cc
cd /tmp/grpc/cmake/build && make -j 2

What version of Abseil are you using?

branche is lts_2020_02_25

What operating system and version are you using?

[root]# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)

What compiler and version are you using?

[root]# gcc -v
使用内建 specs。
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
目标:x86_64-redhat-linux
配置为:../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
线程模型:posix
gcc 版本 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)

What build system are you using?

[root]# cmake --version
cmake version 3.16.3

CMake suite maintained and supported by Kitware (kitware.com/cmake).

Additional context

when I change it below, it work.

change before

template <typename... Args>
ABSL_MUST_USE_RESULT std::string StrFormat(const FormatSpec<Args...>& format,
                                           const Args&... args) {
  return str_format_internal::FormatPack(
      str_format_internal::UntypedFormatSpecImpl::Extract(format),
      {str_format_internal::FormatArgImpl(args)...});
}

change after

template <typename Type, typename... Args>
ABSL_MUST_USE_RESULT std::string StrFormat(const Type & format,
                                           const Args&... args) {
  return str_format_internal::FormatPack(
      str_format_internal::UntypedFormatSpecImpl::Extract(FormatSpec<Args...>(format)),
      {str_format_internal::FormatArgImpl(args)...});
}

lts_2020_02_25 and GCC 4.8 are no longer supported.