Compile fails using valarray on 3.4.0 but not 3.3.2

Steven T. Hatton hattons@globalsymmetry.com
Tue Apr 27 18:39:00 GMT 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

One this kind of system:
2.4.21-192-default #1 Wed Feb 18 19:26:28 UTC 2004 i686 i686 i386 GNU/Linux

the code found on this page:
http://www.research.att.com/~bs/3rd_code.html,

at this bullet:
Chapter 22:  pg 668 Slices and matrix example (sec22.4.5,224.6,22.6.2),

and located at this URL: 
http://www.research.att.com/~bs/matrix.c,

fails to build with a simple g++ matrix.c  on the command line.  

I have tried this with both GCC 3.3.2 (which succeeds) and GCC 3.4.0 (which 
fails).  In both cases I built GCC with these configure options:
 "--prefix=/opt/org/gnu/gcc-3.4.0 --enable-languages=c++,c".

Both builds were done in a fresh build directory using make bootstrap. The 
relevant environment variables such as LIBRARY_PATH, CPLUS_INCLUDE_PATH, PATH 
are all set by one GNU_GCC variable which I changed for each build. 

Could someone please verify this.

Here's the carnage:

Tue Apr 27 12:18:48:> g++ matrix.cc 
matrix.cc: In instantiation of `Slice_iter<double>':
matrix.cc:145:   instantiated from here
matrix.cc:36: error: template-id `operator==<>' for `bool operator==(const 
Slice_iter<double>&, const Slice_iter<double>&)' does not match any template 
declaration
matrix.cc:37: error: template-id `operator!=<>' for `bool operator!=(const 
Slice_iter<double>&, const Slice_iter<double>&)' does not match any template 
declaration
matrix.cc:38: error: template-id `operator< <>' for `bool operator<(const 
Slice_iter<double>&, const Slice_iter<double>&)' does not match any template 
declaration
matrix.cc: In instantiation of `Cslice_iter<double>':
matrix.cc:146:   instantiated from here
matrix.cc:91: error: template-id `operator==<>' for `bool operator==(const 
Cslice_iter<double>&, const Cslice_iter<double>&)' does not match any 
template declaration
matrix.cc:92: error: template-id `operator!=<>' for `bool operator!=(const 
Cslice_iter<double>&, const Cslice_iter<double>&)' does not match any 
template declaration
matrix.cc:93: error: template-id `operator< <>' for `bool operator<(const 
Cslice_iter<double>&, const Cslice_iter<double>&)' does not match any 
template declaration
matrix.cc: In function `bool operator==(const Slice_iter<T>&, const 
Slice_iter<T>&) [with T = double]':
matrix.cc:54:   instantiated from `bool operator!=(const Slice_iter<T>&, const 
Slice_iter<T>&) [with T = double]'
matrix.cc:299:   instantiated from here
matrix.cc:15: error: `std::slice Slice_iter<double>::s' is private
matrix.cc:46: error: within this context
matrix.cc:15: error: `std::slice Slice_iter<double>::s' is private
matrix.cc:46: error: within this context
matrix.cc:15: error: `std::slice Slice_iter<double>::s' is private
matrix.cc:46: error: within this context
matrix.cc:15: error: `std::slice Slice_iter<double>::s' is private
matrix.cc:46: error: within this context
matrix.cc:16: error: `size_t Slice_iter<double>::curr' is private
matrix.cc:46: error: within this context
matrix.cc:16: error: `size_t Slice_iter<double>::curr' is private
matrix.cc:46: error: within this context
matrix.cc: In function `bool operator==(const Cslice_iter<T>&, const 
Cslice_iter<T>&) [with T = double]':
matrix.cc:108:   instantiated from `bool operator!=(const Cslice_iter<T>&, 
const Cslice_iter<T>&) [with T = double]'
/opt/org/gnu/gcc-3.4.0/lib/gcc/i686-pc-linux-gnu/3.4.0/../../../../include/c++/3.4.0/bits/stl_numeric.h:144:   
instantiated from `_Tp std::inner_product(_InputIterator1, _InputIterator1, 
_InputIterator2, _Tp) [with _InputIterator1 = Cslice_iter<double>, 
_InputIterator2 = double*, _Tp = double]'
matrix.cc:231:   instantiated from here
matrix.cc:73: error: `std::slice Cslice_iter<double>::s' is private
matrix.cc:100: error: within this context
matrix.cc:73: error: `std::slice Cslice_iter<double>::s' is private
matrix.cc:100: error: within this context
matrix.cc:73: error: `std::slice Cslice_iter<double>::s' is private
matrix.cc:100: error: within this context
matrix.cc:73: error: `std::slice Cslice_iter<double>::s' is private
matrix.cc:100: error: within this context
matrix.cc:74: error: `size_t Cslice_iter<double>::curr' is private
matrix.cc:100: error: within this context
matrix.cc:74: error: `size_t Cslice_iter<double>::curr' is private
matrix.cc:100: error: within this context
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQFAjo43wX61+IL0QsMRAoDQAJ0fnVRx4Ck1Er79/t3FeILNcEToZwCg2ivg
7In9gHN5pGU5kDb8aanSRr0=
=tWmg
-----END PGP SIGNATURE-----



More information about the Gcc mailing list