Skip to content

gcc-12.1.1 -Werror doesn't like your tests #113

Description

@l29ah
FAILED: tests/CMakeFiles/geostationary-t.dir/testcase_reader.cpp.o 
/usr/lib/ccache/bin/x86_64-pc-linux-gnu-g++ -D_XOPEN_SOURCE=700 -I/var/tmp/portage/dev-libs/libpredict-9999/work/libpredict-9999_build/include  -O2 -pipe -march=native -ftree-vectorize -malign-data=cacheline -mtls-dialect=gnu2 -Wall -Werror -Wall -Werror -MD -MT tests/CMakeFiles/geostationary-t.dir/testcase_reader.cpp.o -MF tests/CMakeFiles/geostationary-t.dir/testcase_reader.cpp.o.d -o tests/CMakeFiles/geostationary-t.dir/testcase_reader.cpp.o -c /var/tmp/portage/dev-libs/libpredict-9999/work/libpredict-9999/tests/testcase_reader.cpp
/var/tmp/portage/dev-libs/libpredict-9999/work/libpredict-9999/tests/testcase_reader.cpp: In function ‘std::string& ltrim(std::string&)’:
/var/tmp/portage/dev-libs/libpredict-9999/work/libpredict-9999/tests/testcase_reader.cpp:35:93: error: ‘std::pointer_to_unary_function<_Arg, _Result> std::ptr_fun(_Result (*)(_Arg)) [with _Arg = int; _Result = int]’ is deprecated: use 'std::function' instead [-Werror=deprecated-declarations]
   35 |         s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun<int, int>(std::isspace))));
      |                                                                       ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1/include/g++-v12/string:48,
                 from /var/tmp/portage/dev-libs/libpredict-9999/work/libpredict-9999/tests/testcase_reader.h:4,
                 from /var/tmp/portage/dev-libs/libpredict-9999/work/libpredict-9999/tests/testcase_reader.cpp:1:
/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1/include/g++-v12/bits/stl_function.h:1126:5: note: declared here
 1126 |     ptr_fun(_Result (*__x)(_Arg))
      |     ^~~~~~~
/var/tmp/portage/dev-libs/libpredict-9999/work/libpredict-9999/tests/testcase_reader.cpp:35:70: error: ‘constexpr std::unary_negate<_Predicate> std::not1(const _Predicate&) [with _Predicate = pointer_to_unary_function<int, int>]’ is deprecated: use 'std::not_fn' instead [-Werror=deprecated-declarations]
   35 |         s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun<int, int>(std::isspace))));
      |                                                             ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1/include/g++-v12/bits/stl_function.h:1046:5: note: declared here
 1046 |     not1(const _Predicate& __pred)
      |     ^~~~
/var/tmp/portage/dev-libs/libpredict-9999/work/libpredict-9999/tests/testcase_reader.cpp: In function ‘std::string& rtrim(std::string&)’:
/var/tmp/portage/dev-libs/libpredict-9999/work/libpredict-9999/tests/testcase_reader.cpp:41:84: error: ‘std::pointer_to_unary_function<_Arg, _Result> std::ptr_fun(_Result (*)(_Arg)) [with _Arg = int; _Result = int]’ is deprecated: use 'std::function' instead [-Werror=deprecated-declarations]
   41 |         s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::ptr_fun<int, int>(std::isspace))).base(), s.end());
      |                                                              ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1/include/g++-v12/bits/stl_function.h:1126:5: note: declared here
 1126 |     ptr_fun(_Result (*__x)(_Arg))
      |     ^~~~~~~
/var/tmp/portage/dev-libs/libpredict-9999/work/libpredict-9999/tests/testcase_reader.cpp:41:61: error: ‘constexpr std::unary_negate<_Predicate> std::not1(const _Predicate&) [with _Predicate = pointer_to_unary_function<int, int>]’ is deprecated: use 'std::not_fn' instead [-Werror=deprecated-declarations]
   41 |         s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::ptr_fun<int, int>(std::isspace))).base(), s.end());
      |                                                    ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1/include/g++-v12/bits/stl_function.h:1046:5: note: declared here
 1046 |     not1(const _Predicate& __pred)
      |     ^~~~
cc1plus: all warnings being treated as errors

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