Consider the current code for _StorageType<_Tp*> specialization (in stlport/stl/pointers/_tools.h):
template <class _Tp>
struct _StorageType<_Tp*> {
// Even if we detect a pointer type we use dispatch function to consider if it can be stored as a void*.
// For instance function pointer might not necessarily be convertible to void*.
enum { use_void_ptr = (sizeof(_UseVoidPtrStorageType(__true_type(),
__STATIC_CAST(_Tp*, 0))) == sizeof(char*)) };
enum { use_const_volatile_void_ptr = use_void_ptr };
typedef typename __select<use_void_ptr,
void*,
_Tp*>::_Ret _QualifiedType;
If _Tp is a template, this STATIC_CAST will instantiate it. This is (a) unneeded, and (b) can result in a compilation error if instantiation of _Tp will, in turn, reference _StorageType<_Tp*>::_QualifiedType, which is not defined at this point.
Instantiation happens because of the argument dependent lookup of a friend _UseVoidPtrStorageType() in _Tp. This is definitely not an intended behavior. The fix is to refer to _UseVoidPtrStorageType() and similar functions by their fully-qualified names. The patch is attached.
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
Fix.
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
A minimized case of compilation failure
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
Note that you can not reproduce this bug with gcc - it will silently ignore the instatiation failure. It is reproducible with Clang and Comeau.
Looks like ADL (aka Koenig lookup) bug of mentioned compilers.
Report is incomplete: no reference to STLport's code, no reference to compilers, no reference to OS. Absent message from compiler (item one: what happens?).