Repository navigation
Closed
Description
I'm building ros2 beta2, and I've run into some issues with some code in function_traits and its tests.
- fedora 26 x86_64
- gcc-7.1.1
[ 91%] Building CXX object CMakeFiles/test_function_traits.dir/test/test_function_traits.cpp.o
/usr/bin/c++ -I/home/rich/code/ros2-beta2/src/ros2/rclcpp/rclcpp/include -I/home/rich/code/ros2-beta2/install/include -Wall -Wextra -Wpedantic -pthread -std=gnu++14 -o CMakeFiles/test_function_traits.dir/test/test_function_traits.cpp.o -c /home/rich/code/ros2-beta2/src/ros2/rclcpp/rclcpp/test/test_function_traits.cpp
In file included from /home/rich/code/ros2-beta2/src/ros2/rclcpp/rclcpp/test/test_function_traits.cpp:20:0:
/home/rich/code/ros2-beta2/src/ros2/rclcpp/rclcpp/include/rclcpp/function_traits.hpp: In instantiation of ‘struct rclcpp::function_traits::function_traits<std::_Bind<int (ObjectMember::*(ObjectMember*, std::_Placeholder<1>))(bool)> >’:
/home/rich/code/ros2-beta2/src/ros2/rclcpp/rclcpp/test/test_function_traits.cpp:394:72: required from here
/home/rich/code/ros2-beta2/src/ros2/rclcpp/rclcpp/include/rclcpp/function_traits.hpp:52:85: error: decltype cannot resolve address of overloaded function
typename function_traits<decltype( & FunctionT::operator())>::arguments>::type;
^
/home/rich/code/ros2-beta2/src/ros2/rclcpp/rclcpp/include/rclcpp/function_traits.hpp:57:72: error: decltype cannot resolve address of overloaded function
using argument_type = typename std::tuple_element<N, arguments>::type;
^
/home/rich/code/ros2-beta2/src/ros2/rclcpp/rclcpp/include/rclcpp/function_traits.hpp:59:96: error: decltype cannot resolve address of overloaded function
using return_type = typename function_traits<decltype( & FunctionT::operator())>::return_type;
^
/home/rich/code/ros2-beta2/src/ros2/rclcpp/rclcpp/test/test_function_traits.cpp: In member function ‘virtual void TestFunctionTraits_argument_types_Test::TestBody()’:
/home/rich/code/ros2-beta2/src/ros2/rclcpp/rclcpp/test/test_function_traits.cpp:395:5: error: template argument 2 is invalid
>::value, "Functor accepts a bool as first argument");
^
In file included from /home/rich/code/ros2-beta2/src/ros2/rclcpp/rclcpp/test/test_function_traits.cpp:20:0:
/home/rich/code/ros2-beta2/src/ros2/rclcpp/rclcpp/include/rclcpp/function_traits.hpp: In instantiation of ‘struct rclcpp::function_traits::function_traits<std::_Bind<int (ObjectMember::*(ObjectMember*, std::_Placeholder<1>, std::_Placeholder<2>))(bool, bool)> >’:
/home/rich/code/ros2-beta2/src/ros2/rclcpp/rclcpp/test/test_function_traits.cpp:404:73: required from here
/home/rich/code/ros2-beta2/src/ros2/rclcpp/rclcpp/include/rclcpp/function_traits.hpp:52:85: error: decltype cannot resolve address of overloaded function
typename function_traits<decltype( & FunctionT::operator())>::arguments>::type;
^
/home/rich/code/ros2-beta2/src/ros2/rclcpp/rclcpp/include/rclcpp/function_traits.hpp:57:72: error: decltype cannot resolve address of overloaded function
using argument_type = typename std::tuple_element<N, arguments>::type;
^
/home/rich/code/ros2-beta2/src/ros2/rclcpp/rclcpp/include/rclcpp/function_traits.hpp:59:96: error: decltype cannot resolve address of overloaded function
using return_type = typename function_traits<decltype( & FunctionT::operator())>::return_type;
^
/home/rich/code/ros2-beta2/src/ros2/rclcpp/rclcpp/test/test_function_traits.cpp:405:5: error: template argument 2 is invalid
>::value, "Functor accepts a bool as first argument");
^
/home/rich/code/ros2-beta2/src/ros2/rclcpp/rclcpp/test/test_function_traits.cpp:411:5: error: template argument 2 is invalid
>::value, "Functor accepts a bool as second argument");
^
In file included from /home/rich/code/ros2-beta2/src/ros2/rclcpp/rclcpp/test/test_function_traits.cpp:20:0:
/home/rich/code/ros2-beta2/src/ros2/rclcpp/rclcpp/include/rclcpp/function_traits.hpp: In instantiation of ‘struct rclcpp::function_traits::function_traits<std::_Bind<int (ObjectMember::*(ObjectMember*, std::_Placeholder<1>, std::_Placeholder<2>))(bool, float)> >’:
/home/rich/code/ros2-beta2/src/ros2/rclcpp/rclcpp/test/test_function_traits.cpp:422:8: required from here
/home/rich/code/ros2-beta2/src/ros2/rclcpp/rclcpp/include/rclcpp/function_traits.hpp:52:85: error: decltype cannot resolve address of overloaded function
typename function_traits<decltype( & FunctionT::operator())>::arguments>::type;
^
/home/rich/code/ros2-beta2/src/ros2/rclcpp/rclcpp/include/rclcpp/function_traits.hpp:57:72: error: decltype cannot resolve address of overloaded function
using argument_type = typename std::tuple_element<N, arguments>::type;
^
/home/rich/code/ros2-beta2/src/ros2/rclcpp/rclcpp/include/rclcpp/function_traits.hpp:59:96: error: decltype cannot resolve address of overloaded function
using return_type = typename function_traits<decltype( & FunctionT::operator())>::return_type;
^
/home/rich/code/ros2-beta2/src/ros2/rclcpp/rclcpp/test/test_function_traits.cpp:423:5: error: template argument 2 is invalid
>::value, "Functor accepts a bool as first argument");
^
/home/rich/code/ros2-beta2/src/ros2/rclcpp/rclcpp/test/test_function_traits.cpp:431:5: error: template argument 2 is invalid
>::value, "Functor accepts a float as second argument");
^
/home/rich/code/ros2-beta2/src/ros2/rclcpp/rclcpp/test/test_function_traits.cpp: In member function ‘virtual void TestFunctionTraits_check_arguments_Test::TestBody()’:
/home/rich/code/ros2-beta2/src/ros2/rclcpp/rclcpp/test/test_function_traits.cpp:562:78: error: ‘value’ is not a member of ‘rclcpp::function_traits::check_arguments<std::_Bind<int (ObjectMember::*(ObjectMember*, std::_Placeholder<1>))(bool)>, bool>’
rclcpp::function_traits::check_arguments<decltype(bind_one_bool), bool>::value,
^~~~~
make[2]: *** [CMakeFiles/test_function_traits.dir/build.make:66: CMakeFiles/test_function_traits.dir/test/test_function_traits.cpp.o] Error 1
make[2]: Leaving directory '/home/rich/code/ros2-beta2/build/rclcpp'
make[1]: *** [CMakeFiles/Makefile2:1439: CMakeFiles/test_function_traits.dir/all] Error 2
make[1]: Leaving directory '/home/rich/code/ros2-beta2/build/rclcpp'
make: *** [Makefile:144: all] Error 2
Metadata
Metadata
Assignees
Labels
No labels
Activity
allenh1 commentedon Jul 20, 2017
Let me look into this -- I have GCC 8 on my laptop. let me see if I can reproduce this, or if I need to talk to the GCC people again. ;)
Update: I can indeed build rclcpp with GCC 8.0:
Are you compiling beta2 or master?
Update: From a clean workspace, I can still build rclcpp; however, my build did fail when I got to the composition demo, with the same error you mentioned.
allenh1 commentedon Jul 20, 2017
Full compiler error:
richmattes commentedon Jul 20, 2017
Yes, I was building beta2 following the instructions here
The command I used was:
mikaelarguedas commentedon Jul 26, 2017
@allenh1 to provide feedback on this and move in the appropriate column
clalancette commentedon Jul 28, 2017
I think this is originally @esteve 's code. @esteve , any thoughts on what is going on here and how to fix it?
allenh1 commentedon Jul 28, 2017
I'm currently talking to the GCC people to find out if this is a bug. I'll post back when I know more.
esteve commentedon Jul 29, 2017
@clalancette thanks for reaching out. I've submitted #346 which should address this.
@allenh1 it's actually an issue in
function_traits.function_traitsis rather fragile when dealing withstd::bindbecause there's no requirement in the C++ standard on how to implement it, sofunction_traitsdepends on the internal implementation to match the return type, arguments, etc. of a functor. There's nothing much that can be done, except updatingfunction_traitswheneverstd::bindchanges, which is not very often.mikaelarguedas commentedon Aug 1, 2017
Closed via #346 thanks @jpgr87 for the initial report
Add timer to action server to check expired goals + asan fixes (ros2#343
Subscribe to topics using the common offered QoS (ros2#343)