[Bug c++/19883] [4.0 regression] Even more array bounds rejected as non-constant in template...

bredelin at ucla dot edu gcc-bugzilla@gcc.gnu.org
Thu Feb 17 20:48:00 GMT 2005


------- 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



More information about the Gcc-bugs mailing list