Opened 11 years ago

Closed 11 years ago

#6062 closed Bugs (fixed)

Incompatibility boost.unordered and boost.asio.

Reported by: Vladislav <phprus@…> Owned by: Daniel James
Milestone: Boost 1.48.0 Component: unordered
Version: Boost Release Branch Severity: Showstopper
Keywords: gcc icc Cc:

Description

Program:

#include <boost/asio.hpp>
#include <boost/unordered_map.hpp>
int main()
{
	boost::unordered_map<void* , void* > umap;
	return 0;
}

leads to errors (GCC 4.5.1):

phprus@notebook-hp6360b:~/science/workspace/Boost/testcase/1.48.0.beta1> gcc -I/home/phprus/opt/icmm/boost/1.48.0.beta1/include -c unorgered.cpp 
In file included from /home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/buckets.hpp:16:0,
                 from /home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/table.hpp:10,
                 from /home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/equivalent.hpp:14,
                 from /home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/unordered_map.hpp:18,
                 from /home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered_map.hpp:16,
                 from unorgered.cpp:2:
/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp:135:1: error: expected unqualified-id before numeric constant
/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp:135:1: error: expected ‘;’ before numeric constant
/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp:135:1: error: expected unqualified-id before numeric constant
/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp:135:1: error: expected unqualified-id before numeric constant
/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp:135:1: error: expected ‘)’ before numeric constant
/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp:135:1: error: expected unqualified-id before numeric constant
/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp:135:1: error: expected ‘;’ before numeric constant
/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp:135:1: error: expected unqualified-id before numeric constant
/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp:135:1: error: expected unqualified-id before numeric constant
/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp:135:1: error: expected ‘)’ before numeric constant
/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp:135:1: error: expected unqualified-id before numeric constant
/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp:135:1: error: expected ‘;’ before numeric constant
/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp:135:1: error: expected unqualified-id before numeric constant
/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp:135:1: error: expected unqualified-id before numeric constant
/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp:135:1: error: expected ‘)’ before numeric constant
/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp:135:1: error: expected unqualified-id before numeric constant
/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp:135:1: error: expected ‘;’ before numeric constant
/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp:135:1: error: expected unqualified-id before numeric constant
/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp:135:1: error: expected unqualified-id before numeric constant
/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp:135:1: error: expected ‘)’ before numeric constant
/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp:135:1: error: expected unqualified-id before numeric constant
/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp:135:1: error: expected ‘;’ before numeric constant
/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp:135:1: error: expected unqualified-id before numeric constant
/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp:135:1: error: expected unqualified-id before numeric constant
/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp:135:1: error: expected ‘)’ before numeric constant
/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp:135:1: error: expected unqualified-id before numeric constant
/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp:135:1: error: expected ‘;’ before numeric constant
/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp:135:1: error: expected unqualified-id before numeric constant
/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp:135:1: error: expected unqualified-id before numeric constant
/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp:135:1: error: expected ‘)’ before numeric constant
/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp:135:1: error: expected unqualified-id before numeric constant
/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp:135:1: error: expected ‘;’ before numeric constant
/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp:135:1: error: expected unqualified-id before numeric constant
/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp:135:1: error: expected unqualified-id before numeric constant
/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp:135:1: error: expected ‘)’ before numeric constant
/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp:135:1: error: expected unqualified-id before numeric constant
/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp:135:1: error: expected ‘;’ before numeric constant
/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp:135:1: error: expected unqualified-id before numeric constant
/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp:135:1: error: expected unqualified-id before numeric constant
/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp:135:1: error: expected ‘)’ before numeric constant
/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp:135:1: error: expected unqualified-id before numeric constant
/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp:135:1: error: expected ‘;’ before numeric constant
/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp:135:1: error: expected unqualified-id before numeric constant
/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp:135:1: error: expected unqualified-id before numeric constant
/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp:135:1: error: expected ‘)’ before numeric constant

or errors (Intel C++ 12.0.4):

phprus@notebook-hp6360b:~/science/workspace/Boost/testcase/1.48.0.beta1> icpc -I/home/phprus/opt/icmm/boost/1.48.0.beta1/include -c unorgered.cpp /home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/move/move.hpp(236): warning #1292: attribute "__may_alias__" ignored
     } BOOST_MOVE_ATTRIBUTE_MAY_ALIAS;
       ^

/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp(134): error: expected an identifier
  BOOST_PP_REPEAT_FROM_TO(1, BOOST_UNORDERED_EMPLACE_LIMIT, BOOST_UNORDERED_EARGS,
  ^

/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp(134): error: expected a declaration
  BOOST_PP_REPEAT_FROM_TO(1, BOOST_UNORDERED_EMPLACE_LIMIT, BOOST_UNORDERED_EARGS,
  ^

/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp(134): error: invalid type for a bit field
  BOOST_PP_REPEAT_FROM_TO(1, BOOST_UNORDERED_EMPLACE_LIMIT, BOOST_UNORDERED_EARGS,
  ^

/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp(134): error: identifier "a0" is undefined
  BOOST_PP_REPEAT_FROM_TO(1, BOOST_UNORDERED_EMPLACE_LIMIT, BOOST_UNORDERED_EARGS,
  ^

/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp(134): error: function call is not allowed in a constant expression
  BOOST_PP_REPEAT_FROM_TO(1, BOOST_UNORDERED_EMPLACE_LIMIT, BOOST_UNORDERED_EARGS,
  ^

/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp(134): error: expression must have a constant value
  BOOST_PP_REPEAT_FROM_TO(1, BOOST_UNORDERED_EMPLACE_LIMIT, BOOST_UNORDERED_EARGS,
  ^

/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp(134): error: expected a ";"
  BOOST_PP_REPEAT_FROM_TO(1, BOOST_UNORDERED_EMPLACE_LIMIT, BOOST_UNORDERED_EARGS,
  ^

/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp(134): error: expected a ")"
  BOOST_PP_REPEAT_FROM_TO(1, BOOST_UNORDERED_EMPLACE_LIMIT, BOOST_UNORDERED_EARGS,
  ^

/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp(134): error: "B1" has already been declared in the current scope
  BOOST_PP_REPEAT_FROM_TO(1, BOOST_UNORDERED_EMPLACE_LIMIT, BOOST_UNORDERED_EARGS,
  ^

/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/unordered/detail/emplace_args.hpp(134): warning #411: class template "boost::unordered::detail::emplace_args2<A0, A1>" defines no constructor to initialize the following:
            reference member "boost::unordered::detail::emplace_args2<A0, A1>::a1"
  BOOST_PP_REPEAT_FROM_TO(1, BOOST_UNORDERED_EMPLACE_LIMIT, BOOST_UNORDERED_EARGS,
  ^

/home/phprus/opt/icmm/boost/1.48.0.beta1/include/boost/array.hpp(121): warning #279: controlling expression is constant
              BOOST_ASSERT( i < N && "out of range" ); 
              ^

compilation aborted for unorgered.cpp (code 2)

OS: openSUSE 11.4 x86_64.

Attachments (1)

unordered.patch (1.9 KB ) - added by anonymous 11 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 by Daniel James, 11 years ago

Status: newassigned

Looks like the macro B0 is defined by something included by asio. I'll rename it, won't be in the beta though.

comment:2 by Vladislav <phprus@…>, 11 years ago

In release 1.48.0 this bug will be fixed?

Please send a patch for the beta-version that I could test remaining, used by me, Boost libraries.

comment:3 by Daniel James, 11 years ago

(In [75123]) Unordered: Rename B0, B1 etc. to avoid macro clash. Refs #6062.

by anonymous, 11 years ago

Attachment: unordered.patch added

comment:4 by anonymous, 11 years ago

Resolution: fixed
Status: assignedclosed

Fixed in [75293].

Note: See TracTickets for help on using tickets.