Boost logo

Boost :

From: Gubenko, Boris (boris.gubenko_at_[hidden])
Date: 2008-08-01 15:24:24


Boost.Test library test basic_cstring_test.cpp fails to compile
on many (all?) platforms using GNU libstdc++. Follows reproducer
and the results of compiling it with GNU 4.3.0 and 3.4.6.

Replacing 'utf::basic_cstring<CharT>::size_type' with 'std::size_t'
in libs/test/test/basic_cstring_test.cpp makes the problem go away.

Is it a known problem in GNU libstdc++? Does the fact that the
implementation does not have to provide specializations of
basic_string<> other than for 'char' and 'wchar_t' makes x.cpp
below illegal?

Thanks,
  Boris

x.cpp
-----
#include <string>

template<typename T> void foo(T) {
  std::basic_string<T>::size_type i = 1;
}

bash-2.03$ g++ -dumpversion ; g++ -c x.cpp
4.3.0
x.cpp: In function 'void foo(T)':
x.cpp:4: error: expected `;' before 'i'
bash-2.03$

bash-3.00$ g++ -dumpversion ; g++ -c x.cpp
3.4.6
x.cpp: In function `void foo(T)':
x.cpp:4: error: expected `;' before "i"
bash-3.00$


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk