This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/19883] [4.0 regression] Even more array bounds rejected as non-constant in template...
- From: "bredelin at ucla dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Feb 2005 16:45:15 -0000
- Subject: [Bug c++/19883] [4.0 regression] Even more array bounds rejected as non-constant in template...
- References: <20050210221313.19883.reichelt@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From bredelin at ucla dot edu 2005-02-17 16:45 -------
Note that this bug breaks BOOST.
Here is a reduced testcase, which comes from boost/mpl/aux_/integral_wrapper.hpp:
------------------ begin testcase
template< typename T, T N >
struct integral_c
{
static const T value = N;
typedef integral_c< T, static_cast<T>((value + 1)) > next;
// typedef integral_c< T, static_cast<T>((value - 1)) > prior;
// operator T() const { return static_cast<T>(this->value); }
};
------------------- end testcase
% g++-cvs testcase.C
c.C:6: error: template argument 2 is invalid
The original error was obtained by including <boost/numeric/ublas/matrix.hpp>
The following error was recieved:
In file included from /usr/include/boost/config.hpp:35,
from /usr/include/boost/numeric/ublas/config.hpp:24,
from /usr/include/boost/numeric/ublas/matrix.hpp:20,
from a.C:1:
/usr/include/boost/config/compiler/gcc.hpp:92:7: warning: #warning "Unknown
compiler version - please run the configure tests and report the results"
/usr/include/boost/mpl/aux_/integral_wrapper.hpp:72: error: template argument 2
is invalid
/usr/include/boost/mpl/aux_/integral_wrapper.hpp:73: error: template argument 2
is invalid
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19883