tests/generictask_test_3.cpp does not compile on intel compilers

Hi,
when compiling orocos-rtt-1.6.0/tests/generictask_test_3.cpp with intel compiler 10 or 11, it fails:
{{{
generictask_test_3.cpp(730): error #453: protected function "RTT::DataPortBase::operator=(RTT::DataObjectInterface *) [with T=double]" (declared at line 72 of "/opt/orocos-rtt/include/rtt/DataPort.hpp") is not accessible through a "RTT::DataPort" pointer or object
dp = new DataObject("");
^

generictask_test_3.cpp(731): error #453: protected function "RTT::DataPortBase::operator=(RTT::DataObjectInterface *) [with T=double]" (declared at line 72 of "/opt/orocos-rtt/include/rtt/DataPort.hpp") is not accessible through a "RTT::DataPort" pointer or object
dp2 = new DataObject("");
}}}

which is reasonable, since DataPort defines the operator= as protected:
{{{
template
class DataPort
: public DataPortBase
{
protected:
T minitial_value;
using DataPortBase::mconn;
using DataPortBase::operator=;
}}}
and generictask_test_3.cpp uses the operator=
{{{
DataPort dp("DName");
DataPort dp2("D2Name");

...
dp = new DataObject("");
dp2 = new DataObject("");
}}}

According to http://gcc.gnu.org/ml/gcc-prs/2001-07/msg00591.html, it shouldn't be possible to change member access with a using, and maybe so it shouldn't even compile with g++, but I can't say

thanks

tests/generictask_test_3.cpp does not compile on intel compilers

On Wednesday 15 October 2008 12:43:59 orocos [..] ... wrote:
> Hi,
> when compiling orocos-rtt-1.6.0/tests/generictask_test_3.cpp with intel
> compiler 10 or 11, it fails: {{{
> generictask_test_3.cpp(730): error #453: protected function
> "RTT::DataPortBase::operator=(RTT::DataObjectInterface *) [with T=double]"
> (declared at line 72 of "/opt/orocos-rtt/include/rtt/DataPort.hpp") is not
> accessible through a "RTT::DataPort" pointer or object dp = new
> DataObject("");

It's a bug. The DataPortBase::operator= should be public (which the unit test
tests). I'm guessing this means that the using directive should be in a
public: section of the class.

It does compile with g++ 4.2.4

Peter

--
Peter Soetens -- FMTC --
--
Orocos-Dev mailing list
Orocos-Dev [..] ...
http://lists.mech.kuleuven.be/mailman/listinfo/orocos-dev

Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

tests/generictask_test_3.cpp does not compile on intel compilers

Yes, it compiles with g++ 4.3.2 also.
I'm not sure if it should be also public for ReadDataPort and WriteDataPort

dani

tests/generictask_test_3.cpp does not compile on intel compilers

On Wednesday 15 October 2008 14:47:06 orocos [..] ... wrote:
> Yes, it compiles with g++ 4.3.2 also.
> I'm not sure if it should be also public for ReadDataPort and WriteDataPort

I changed all three classes. Fixed on rtt/trunk. Will be in 1.6.1. Thanks for
reporting !

$ svn ci DataPort.hpp -m"Fix compilation errors with Intel compiler: move
using operator=; directive to public: "
Sending DataPort.hpp
Transmitting file data .
Committed revision 29681.

Peter