Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some test files failed to build due to "error: 'namespace arg = boost::cnv::boost::cnv::parameter;' redeclared as different kind of symbol" #45

Closed
BinCaoWR opened this issue May 28, 2019 · 6 comments

Comments

@BinCaoWR
Copy link
Contributor

The following files failed to build:
../libs/convert/test/performance.cpp:31:38: error: 'namespace arg = boost::cnv::boost::cnv::parameter;' redeclared as different kind of symbol
../libs/convert/test/spirit_converter.cpp:22:38: error: 'namespace arg = boost::cnv::boost::cnv::parameter;' redeclared as different kind of symbol
../libs/convert/test/stream_converter.cpp:26:38: error: 'namespace arg = boost::cnv::boost::cnv::parameter;' redeclared as different kind of symbol
../libs/convert/test/printf_converter.cpp:19:38: error: 'namespace arg = boost::cnv::boost::cnv::parameter;' redeclared as different kind of symbol
../libs/convert/test/strtol_converter.cpp:166:38: error: 'namespace arg = boost::cnv::boost::cnv::parameter;' redeclared as different kind of symbol

According to http://www.cplusplus.com/reference/complex/arg/, arg should be declared in complex as below:
complex (1) | template T arg (const complex& x);
arithmetic type (2) |  double arg (ArithmeticType x); // additional overloads

As a result, the arg declared in boost test files should be renamed.

@yet-another-user
Copy link
Contributor

Thank you for your input. Much appreciated. Would you mind to clarify under what circumstances it fails to build... because 1) it builds on my machine (ubuntu); 2) it builds and runs in Boorst regression (https://www.boost.org/development/tests/develop/developer/convert.html). From what I understand the "arg" you reference is, in fact, in the std namspace, i.e. std::arg declared in ... which I do not see even included in the mentioned cpp files. SO, again, would you mind shedding some light on how the problem pops up? Thanks.

@BinCaoWR
Copy link
Contributor Author

Thanks for your quick response. I build the tests on gcc-8.1.0 & C++14. If it cannot be reproduced in your environment, it would be probably due to arg is not declared in your complex.h on the C++/toolchain version you are using.
Here is the info about how complex can be included in the boost cpp files.

../libs/convert/test/performance.cpp: At global scope:
../libs/convert/test/performance.cpp:31:38: error: 'namespace arg = boost::cnv::boost::cnv::parameter;' redeclared as different kind of symbol
namespace arg = boost::cnv::parameter;
^
In file included from ccomplex:16,
from complex:5,
from boost_1_70_0/boost/type_traits/is_complex.hpp:12,
from boost_1_70_0/boost/type_traits.hpp:96,
from boost_1_70_0/boost/convert/detail/is_fun.hpp:11,
from boost_1_70_0/boost/convert.hpp:28,
from ../libs/convert/test/performance.cpp:13:
complex.h:664:20: note: previous declaration 'long double arg(_Lcomplex)'
inline long double arg(_Lcomplex _Left)
^~~

@yet-another-user
Copy link
Contributor

yet-another-user commented May 29, 2019 via email

@BinCaoWR
Copy link
Contributor Author

I'm not sure why the boost regression can pass. Perhaps need to confirm if is_complex.hpp is included and how arg(the conditionals, etc) is defined in complex.

@yet-another-user
Copy link
Contributor

I have no forgotten about the issue. Just recently upgraded to gcc-8.3. Will be trying to see why tat might be failing... because IMO it should not. :-)

@yet-another-user
Copy link
Contributor

Can't reproduce. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants