boost library dynamic_bitset.hpp fails to compile with g++ 4.3.3

Bug #429343 reported by Joris Mooij
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
boost1.37 (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: libboost1.37-dev

The header file boost/dynamic_bitset.hpp in libboost1.37-dev fails to compile with g++ 4.3.3 on Ubuntu 9.04.

Software versions affected:
Ubuntu 9.04, with packages 'libboost1.37-dev' and 'g++' installed
apt-cache policy libboost1.37-dev returns version 1.37.0-3ubuntu3
apt-cache policy g++ returns version 4:4.3.3-1ubuntu1

Reproducing the problem:
$ echo '#include <boost/dynamic_bitset.hpp>' > a.cpp
$ g++ --version
g++ (Ubuntu 4.3.3-5ubuntu4) 4.3.3
[...]
$ g++ a.cpp
In file included from /usr/include/boost/dynamic_bitset.hpp:15,
                 from a.cpp:1:
/usr/include/boost/dynamic_bitset/dynamic_bitset.hpp: In member function ‘size_t boost::dynamic_bitset<Block, Allocator>::count() const’:
/usr/include/boost/dynamic_bitset/dynamic_bitset.hpp:1021: error: ‘mode’ cannot appear in a constant-expression
/usr/include/boost/dynamic_bitset/dynamic_bitset.hpp:1021: error: template argument 1 is invalid
/usr/include/boost/dynamic_bitset/dynamic_bitset.hpp:1021: error: expected `>' before ‘*’ token
/usr/include/boost/dynamic_bitset/dynamic_bitset.hpp:1021: error: expected `(' before ‘*’ token
/usr/include/boost/dynamic_bitset/dynamic_bitset.hpp:1021: error: expected primary-expression before ‘>’ token

Revision history for this message
Bruno Rocha Coutinho (bruno-r-coutinho) wrote :

This bug occurs to me too.
It seem that boost 1.40 had a workaround to this gcc 4.3.3 incompatibility.

Revision history for this message
Bruno Rocha Coutinho (bruno-r-coutinho) wrote :

It compiles with g++ 4.1.3 and 4.2.4

[coutinho@darkstar tmp]$ cat a.cpp
#include <iostream>
#include <boost/dynamic_bitset.hpp>

int main() {
 std::cout << "hello world" << std::endl;
}

[coutinho@darkstar tmp]$ g++-4.1 --version
g++-4.1 (GCC) 4.1.3 20080623 (prerelease) (Ubuntu 4.1.2-24ubuntu1)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[coutinho@darkstar tmp]$ g++-4.2 --version
g++-4.2 (GCC) 4.2.4 (Ubuntu 4.2.4-5ubuntu1)
[...]

[coutinho@darkstar tmp]$ g++-4.3 --version
g++-4.3 (Ubuntu 4.3.3-5ubuntu4) 4.3.3
[...]

[coutinho@darkstar tmp]$ g++-4.1 a.cpp
[coutinho@darkstar tmp]$ g++-4.2 a.cpp
[coutinho@darkstar tmp]$ g++-4.3 a.cpp
In file included from /usr/include/boost/dynamic_bitset.hpp:15,
                 from a.cpp:2:
/usr/include/boost/dynamic_bitset/dynamic_bitset.hpp: In member function ‘size_t boost::dynamic_bitset<Block, Allocator>::count() const’:
/usr/include/boost/dynamic_bitset/dynamic_bitset.hpp:1021: error: ‘mode’ cannot appear in a constant-expression
/usr/include/boost/dynamic_bitset/dynamic_bitset.hpp:1021: error: template argument 1 is invalid
/usr/include/boost/dynamic_bitset/dynamic_bitset.hpp:1021: error: expected `>' before ‘*’ token
/usr/include/boost/dynamic_bitset/dynamic_bitset.hpp:1021: error: expected `(' before ‘*’ token
/usr/include/boost/dynamic_bitset/dynamic_bitset.hpp:1021: error: expected primary-expression before ‘>’ token
[coutinho@darkstar tmp]$

summary: - boost library dynamic_bitset.hpp fails to compile
+ boost library dynamic_bitset.hpp fails to compile with g++ 4.3.3
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.