Skip to content

Build error: asyncbuffer.h: cannot bind rvalue reference of type 'log4cxx::helpers::AsyncBuffer::StringViewType&&' to lvalue of type 'const fmt::v11::string_view' #712

@barracuda156

Description

@barracuda156
cd /opt/local/var/macports/build/log4cxx-130b6da5/work/build/src/test/cpp && /opt/local/bin/g++-mp-14 -DFMT_SHARED -I/opt/local/var/macports/build/log4cxx-130b6da5/work/apache-log4cxx-1.7.0/src/test/cpp -I/opt/local/var/macports/build/log4cxx-130b6da5/work/build/src/main/include -I/opt/local/var/macports/build/log4cxx-130b6da5/work/apache-log4cxx-1.7.0/src/main/include -I/opt/local/include/apr-1 -isystem /opt/local/include/libfmt11 -pipe -Os -DNDEBUG -I/opt/local/include -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++20 -arch ppc -mmacosx-version-min=10.6 -MD -MT src/test/cpp/CMakeFiles/asyncappendertestcase.dir/asyncappendertestcase.cpp.o -MF CMakeFiles/asyncappendertestcase.dir/asyncappendertestcase.cpp.o.d -o CMakeFiles/asyncappendertestcase.dir/asyncappendertestcase.cpp.o -c /opt/local/var/macports/build/log4cxx-130b6da5/work/apache-log4cxx-1.7.0/src/test/cpp/asyncappendertestcase.cpp
cd /opt/local/var/macports/build/log4cxx-130b6da5/work/build/src/test/cpp && /opt/local/bin/g++-mp-14 -DFMT_SHARED -I/opt/local/var/macports/build/log4cxx-130b6da5/work/apache-log4cxx-1.7.0/src/test/cpp -I/opt/local/var/macports/build/log4cxx-130b6da5/work/build/src/main/include -I/opt/local/var/macports/build/log4cxx-130b6da5/work/apache-log4cxx-1.7.0/src/main/include -I/opt/local/include/apr-1 -isystem /opt/local/include/libfmt11 -pipe -Os -DNDEBUG -I/opt/local/include -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++20 -arch ppc -mmacosx-version-min=10.6 -MD -MT src/test/cpp/CMakeFiles/autoconfiguretestcase.dir/autoconfiguretestcase.cpp.o -MF CMakeFiles/autoconfiguretestcase.dir/autoconfiguretestcase.cpp.o.d -o CMakeFiles/autoconfiguretestcase.dir/autoconfiguretestcase.cpp.o -c /opt/local/var/macports/build/log4cxx-130b6da5/work/apache-log4cxx-1.7.0/src/test/cpp/autoconfiguretestcase.cpp
In file included from /opt/local/var/macports/build/log4cxx-130b6da5/work/apache-log4cxx-1.7.0/src/main/include/log4cxx/logger.h:26,
                 from /opt/local/var/macports/build/log4cxx-130b6da5/work/apache-log4cxx-1.7.0/src/main/include/log4cxx/loggerinstance.h:22,
                 from /opt/local/var/macports/build/log4cxx-130b6da5/work/apache-log4cxx-1.7.0/src/test/cpp/asyncappendertestcase.cpp:21:
/opt/local/var/macports/build/log4cxx-130b6da5/work/apache-log4cxx-1.7.0/src/main/include/log4cxx/helpers/asyncbuffer.h: In instantiation of 'void log4cxx::helpers::AsyncBuffer::setMessage(fmt::v11::format_string<T ...>, Args&& ...) [with Args = {const char (&)[6]}; fmt::v11::format_string<T ...> = fmt::v11::fstring<const char (&)[6]>]':
/opt/local/var/macports/build/log4cxx-130b6da5/work/apache-log4cxx-1.7.0/src/test/cpp/asyncappendertestcase.cpp:814:4:   required from here
  412 |                         buf.setMessage(fmt LOG4CXX_FMT_VA_ARG(__VA_ARGS__));\
      |                         ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/var/macports/build/log4cxx-130b6da5/work/apache-log4cxx-1.7.0/src/main/include/log4cxx/helpers/asyncbuffer.h:207:33: error: cannot bind rvalue reference of type 'log4cxx::helpers::AsyncBuffer::StringViewType&&' {aka 'fmt::v11::basic_string_view<char>&&'} to lvalue of type 'const fmt::v11::string_view' {aka 'const fmt::v11::basic_string_view<char>'}
  207 |                 initializeForFmt(std::move(fmt_str), std::move(store));
      |                 ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /opt/local/include/libfmt11/fmt/format.h:41,
                 from /opt/local/include/libfmt11/fmt/args.h:17,
                 from /opt/local/var/macports/build/log4cxx-130b6da5/work/apache-log4cxx-1.7.0/src/main/include/log4cxx/helpers/asyncbuffer.h:25:
/opt/local/include/libfmt11/fmt/base.h:2767:21: note:   after user-defined conversion: 'fmt::v11::fstring<T>::operator const fmt::v11::string_view&() const [with T = {const char (&)[6]}; fmt::v11::string_view = fmt::v11::basic_string_view<char>]'
 2767 |   FMT_ALWAYS_INLINE operator const string_view&() const { return str; }
      |                     ^~~~~~~~
/opt/local/var/macports/build/log4cxx-130b6da5/work/apache-log4cxx-1.7.0/src/main/include/log4cxx/helpers/asyncbuffer.h:254:48: note:   initializing argument 1 of 'void log4cxx::helpers::AsyncBuffer::initializeForFmt(StringViewType&&, FmtArgStore&&)'
  254 |         void initializeForFmt(StringViewType&& format_string, FmtArgStore&& args);
      |                               ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/opt/local/var/macports/build/log4cxx-130b6da5/work/apache-log4cxx-1.7.0/src/main/include/log4cxx/helpers/asyncbuffer.h: In instantiation of 'void log4cxx::helpers::AsyncBuffer::setMessage(fmt::v11::format_string<T ...>, Args&& ...) [with Args = {MyStruct&}; fmt::v11::format_string<T ...> = fmt::v11::fstring<MyStruct&>]':
/opt/local/var/macports/build/log4cxx-130b6da5/work/apache-log4cxx-1.7.0/src/test/cpp/asyncappendertestcase.cpp:817:5:   required from here
  412 |                         buf.setMessage(fmt LOG4CXX_FMT_VA_ARG(__VA_ARGS__));\
      |                         ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/var/macports/build/log4cxx-130b6da5/work/apache-log4cxx-1.7.0/src/main/include/log4cxx/helpers/asyncbuffer.h:207:33: error: cannot bind rvalue reference of type 'log4cxx::helpers::AsyncBuffer::StringViewType&&' {aka 'fmt::v11::basic_string_view<char>&&'} to lvalue of type 'const fmt::v11::string_view' {aka 'const fmt::v11::basic_string_view<char>'}
  207 |                 initializeForFmt(std::move(fmt_str), std::move(store));
      |                 ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/include/libfmt11/fmt/base.h:2767:21: note:   after user-defined conversion: 'fmt::v11::fstring<T>::operator const fmt::v11::string_view&() const [with T = {MyStruct&}; fmt::v11::string_view = fmt::v11::basic_string_view<char>]'
 2767 |   FMT_ALWAYS_INLINE operator const string_view&() const { return str; }
      |                     ^~~~~~~~
/opt/local/var/macports/build/log4cxx-130b6da5/work/apache-log4cxx-1.7.0/src/main/include/log4cxx/helpers/asyncbuffer.h:254:48: note:   initializing argument 1 of 'void log4cxx::helpers::AsyncBuffer::initializeForFmt(StringViewType&&, FmtArgStore&&)'
  254 |         void initializeForFmt(StringViewType&& format_string, FmtArgStore&& args);
      |                               ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
make[2]: *** [src/test/cpp/CMakeFiles/asyncappendertestcase.dir/asyncappendertestcase.cpp.o] Error 1
make[2]: Leaving directory `/opt/local/var/macports/build/log4cxx-130b6da5/work/build'
make[1]: *** [src/test/cpp/CMakeFiles/asyncappendertestcase.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 52%] Linking CXX executable autoconfiguretestcase
cd /opt/local/var/macports/build/log4cxx-130b6da5/work/build/src/test/cpp && /opt/local/bin/cmake -E cmake_link_script CMakeFiles/autoconfiguretestcase.dir/link.txt --verbose=ON
/opt/local/bin/g++-mp-14 -pipe -Os -DNDEBUG -I/opt/local/include -D_GLIBCXX_USE_CXX11_ABI=0 -arch ppc -mmacosx-version-min=10.6 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -L/opt/local/lib -Wl,-headerpad_max_install_names CMakeFiles/autoconfiguretestcase.dir/autoconfiguretestcase.cpp.o -o autoconfiguretestcase  libtestingFramework.a util/libtestingUtilities.a ../../main/cpp/liblog4cxx.15.7.0.dylib /opt/local/lib/libapr-1.dylib //usr/lib/libpthread.dylib /opt/local/lib/libfmt11/libfmt.11.2.0.dylib
make[2]: Leaving directory `/opt/local/var/macports/build/log4cxx-130b6da5/work/build'
[ 52%] Built target autoconfiguretestcase
make[1]: Leaving directory `/opt/local/var/macports/build/log4cxx-130b6da5/work/build'
make: *** [all] Error 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions