Boost logo

Boost Users :

Subject: Re: [Boost-users] [container] Compilation failure with clang 3.1
From: Marshall Clow (mclow.lists_at_[hidden])
Date: 2012-05-25 08:38:24


On May 25, 2012, at 1:07 AM, Alexandre Hamez wrote:

> Hello,
>
> When compiling Boost.Container, clang 3.1 (stable release, Mac OS X 10.7.4) fails:
>
> /opt/local/include/boost/container/allocator/allocator_traits.hpp:167:105: error: type name requires a specifier or qualifier
> template <typename T> using rebind_alloc = boost::intrusive::detail::type_rebinder<Alloc, T>::type;
> ^
> /opt/local/include/boost/container/allocator/allocator_traits.hpp:167:59: error: expected ';' after alias declaration
> template <typename T> using rebind_alloc = boost::intrusive::detail::type_rebinder<Alloc, T>::type;
> ^
> ;
> /opt/local/include/boost/container/allocator/allocator_traits.hpp:168:72: error: use of undeclared identifier 'rebind_alloc'
> template <typename T> using rebind_traits = allocator_traits< rebind_alloc<T> >;
> ^
> /opt/local/include/boost/container/allocator/allocator_traits.hpp:168:85: error: 'T' does not refer to a value
> template <typename T> using rebind_traits = allocator_traits< rebind_alloc<T> >;
> ^
> /opt/local/include/boost/container/allocator/allocator_traits.hpp:168:29: note: declared here
> template <typename T> using rebind_traits = allocator_traits< rebind_alloc<T> >;
> ^
> /opt/local/include/boost/container/allocator/allocator_traits.hpp:168:87: error: expected ';' after alias declaration
> template <typename T> using rebind_traits = allocator_traits< rebind_alloc<T> >;
>
> However gcc 4.7 has no problem with it. Does anyone has experienced the same thing and possibly found a workaround?

Currently, on both the trunk and release branches, that line is:
        template <typename T> using rebind_alloc = typename boost::intrusive::detail::type_rebinder<Alloc, T>::type;
(note the extra 'typename')

You might try inserting that, and see if that fixes the problem.

-- Marshall

Marshall Clow Idio Software <mailto:mclow.lists_at_[hidden]>

A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait).
        -- Yu Suzuki



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net