Opened 8 years ago

Last modified 7 years ago

#11207 new Bugs

boost::numeric::ublas::shallow_array_adaptor broken when compiling with -DNDEBUG

Reported by: Mark.Moll@… Owned by: Douglas Gregor
Milestone: To Be Determined Component: numeric
Version: Boost 1.58.0 Severity: Problem
Keywords: Cc:

Description

The attached code does not compile with clang++ 3.6, 3.7svn, Xcode's clang++, or g++ 4.9. I get these errors:

> /usr/bin/clang++ -DNDEBUG -o broken_shallow_array_adaptor broken_shallow_array_adaptor.cpp -I /opt/local/include
In file included from broken_shallow_array_adaptor.cpp:2:
In file included from /opt/local/include/boost/numeric/ublas/matrix.hpp:18:
In file included from /opt/local/include/boost/numeric/ublas/vector.hpp:21:
/opt/local/include/boost/numeric/ublas/storage.hpp:781:9: error: expected member name or ';'
      after declaration specifiers
        template <size_t N>
        ^
/opt/local/include/boost/numeric/ublas/storage.hpp:901:9: error: unknown type name
      'const_iterator'
        const_iterator begin () const {
        ^
/opt/local/include/boost/numeric/ublas/storage.hpp:905:9: error: unknown type name
      'const_iterator'
        const_iterator cbegin () const {
        ^
/opt/local/include/boost/numeric/ublas/storage.hpp:909:9: error: unknown type name
      'const_iterator'
        const_iterator end () const {
        ^
/opt/local/include/boost/numeric/ublas/storage.hpp:913:9: error: unknown type name
      'const_iterator'
        const_iterator cend () const {
        ^
/opt/local/include/boost/numeric/ublas/storage.hpp:929:39: error: use of undeclared identifier
      'const_iterator'
        typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
                                      ^
In file included from broken_shallow_array_adaptor.cpp:2:
In file included from /opt/local/include/boost/numeric/ublas/matrix.hpp:18:
/opt/local/include/boost/numeric/ublas/vector.hpp:477:27: error: no type named 'const_iterator'
      in 'boost::numeric::ublas::shallow_array_adaptor<const double>'
             typedef typename A::const_iterator const_subiterator_type;
                     ~~~~~~~~~~~~^~~~~~~~~~~~~~
broken_shallow_array_adaptor.cpp:11:58: note: in instantiation of template class
      'boost::numeric::ublas::vector<double, boost::numeric::ublas::shallow_array_adaptor<const
      double> >' requested here
    vector<double, shallow_array_adaptor<const double> > tmp2(10, tmp1);
                                                         ^
7 errors generated.

Attachments (2)

broken_shallow_array_adaptor.cpp (379 bytes ) - added by Mark.Moll@… 8 years ago.
patch_numeric-ublas-storage.hpp.diff (1.1 KB ) - added by Mark.Moll@… 8 years ago.

Download all attachments as: .zip

Change History (5)

by Mark.Moll@…, 8 years ago

comment:1 by Mark.Moll@…, 8 years ago

Patch attached.

by Mark.Moll@…, 8 years ago

comment:2 by hugues@…, 7 years ago

Thanks Mark for the patch. We are also affected by this bug.

Let us know if there is something we can do to help get it merged.

Cheers!

comment:3 by hugues@…, 7 years ago

Hi again: in fact this was fixed in the following pull request: https://github.com/uBLAS/ublas/pull/30/files

Cheers!

Note: See TracTickets for help on using tickets.