TartanLlama / expected

C++11/14/17 std::expected with functional-style extensions
https://tl.tartanllama.xyz
Creative Commons Zero v1.0 Universal
1.55k stars 135 forks source link

Some warnings when compiling with g++ 12 #128

Open correaa opened 1 year ago

correaa commented 1 year ago
09:42:59 correaa@pro build ±|master|→ cmake ..
-- The CXX compiler identification is GNU 12.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
...
-- Build files have been written to: /home/correaa/expected/build
09:43:06 correaa@pro build ±|master|→ make
[  7%] Building CXX object CMakeFiles/tl-expected-tests.dir/tests/assignment.cpp.o
/home/correaa/expected/tests/assignment.cpp: In function ‘void C_A_T_C_H_T_E_S_T_2()’:
/home/correaa/expected/tests/assignment.cpp:72:42: warning: variable ‘e3’ set but not used [-Wunused-but-set-variable]
   72 |   tl::expected<except_move, except_move> e3 = {};
      |                                          ^~
/home/correaa/expected/tests/assignment.cpp:73:42: warning: variable ‘e4’ set but not used [-Wunused-but-set-variable]
   73 |   tl::expected<except_move, except_move> e4 = {};
      |                                          ^~
[ 15%] Building CXX object CMakeFiles/tl-expected-tests.dir/tests/bases.cpp.o
[ 23%] Building CXX object CMakeFiles/tl-expected-tests.dir/tests/constexpr.cpp.o
[ 30%] Building CXX object CMakeFiles/tl-expected-tests.dir/tests/constructors.cpp.o
[ 38%] Building CXX object CMakeFiles/tl-expected-tests.dir/tests/emplace.cpp.o
[ 46%] Building CXX object CMakeFiles/tl-expected-tests.dir/tests/extensions.cpp.o
[ 53%] Building CXX object CMakeFiles/tl-expected-tests.dir/tests/issues.cpp.o
/home/correaa/expected/tests/issues.cpp: In function ‘MaybeDataPtr test(int)’:
/home/correaa/expected/tests/issues.cpp:117:19: warning: redundant move in return statement [-Wredundant-move]
  117 |   return std::move(i);
      |          ~~~~~~~~~^~~
/home/correaa/expected/tests/issues.cpp:117:19: note: remove ‘std::move’ call
/home/correaa/expected/tests/issues.cpp: In function ‘MaybeDataPtr test2(int)’:
/home/correaa/expected/tests/issues.cpp:122:19: warning: redundant move in return statement [-Wredundant-move]
  122 |   return std::move(i);
      |          ~~~~~~~~~^~~
/home/correaa/expected/tests/issues.cpp:122:19: note: remove ‘std::move’ call
/home/correaa/expected/tests/issues.cpp: In copy constructor ‘move_tracker::move_tracker(const move_tracker&)’:
/home/correaa/expected/tests/issues.cpp:145:42: warning: unused parameter ‘other’ [-Wunused-parameter]
  145 |         move_tracker(move_tracker const &other) noexcept {};
      |                      ~~~~~~~~~~~~~~~~~~~~^~~~~
/home/correaa/expected/tests/issues.cpp: In member function ‘move_tracker& move_tracker::operator=(const move_tracker&)’:
/home/correaa/expected/tests/issues.cpp:150:56: warning: no return statement in function returning non-void [-Wreturn-type]
  150 |         operator=(move_tracker const &other) noexcept {};
      |                                                        ^
      |                                                        return *this;
/home/correaa/expected/tests/issues.cpp:150:39: warning: unused parameter ‘other’ [-Wunused-parameter]
  150 |         operator=(move_tracker const &other) noexcept {};
      |                   ~~~~~~~~~~~~~~~~~~~~^~~~~
[ 61%] Building CXX object CMakeFiles/tl-expected-tests.dir/tests/main.cpp.o
[ 69%] Building CXX object CMakeFiles/tl-expected-tests.dir/tests/noexcept.cpp.o
[ 76%] Building CXX object CMakeFiles/tl-expected-tests.dir/tests/observers.cpp.o
[ 84%] Building CXX object CMakeFiles/tl-expected-tests.dir/tests/relops.cpp.o
[ 92%] Building CXX object CMakeFiles/tl-expected-tests.dir/tests/swap.cpp.o
[100%] Linking CXX executable tl-expected-tests