andysworkshop/stm32plus — pull request #75 by tokoro10g (2014-12-19 18:05:50+00:00)
Title: Fix bug in stl_deque

This patch fixes compile error when using deque (and iterator).

Code to reproduce:
```cpp
#include
#include

int main() {
std::deque d;
d.push_back(0);
return 0;
}
```

Error message:
```
In file included from ../../stm32plus/lib/include/stl/iterator:30:0,
from main.cpp:1:
../../stm32plus/lib/include/stl/stl_deque.h: In member function 'void std::_Deque_base<_Tp, _Alloc>::_M_initialize_map(std::size_t)':
../../stm32plus/lib/include/stl/stl_deque.h:405:35: error: '_M_map' was not declared in this scope
__STL_UNWIND((_M_deallocate_map(_M_map, _M_map_size),
^
../../stm32plus/lib/include/stl/stl_config.h:566:46: note: in definition of macro '__STL_UNWIND'
# define __STL_UNWIND(action) catch(...) { action; throw; }
^
../../stm32plus/lib/include/stl/stl_deque.h:405:43: error: '_M_map_size' was not declared in this scope
__STL_UNWIND((_M_deallocate_map(_M_map, _M_map_size),
^
../../stm32plus/lib/include/stl/stl_config.h:566:46: note: in definition of macro '__STL_UNWIND'
# define __STL_UNWIND(action) catch(...) { action; throw; }
^
../../stm32plus/lib/include/stl/stl_deque.h:405:54: warning: there are no arguments to '_M_deallocate_map' that depend on a template parameter, so a declaration of '_M_deallocate_map' must be available [-fpermissive]
__STL_UNWIND((_M_deallocate_map(_M_map, _M_map_size),
^
../../stm32plus/lib/include/stl/stl_config.h:566:46: note: in definition of macro '__STL_UNWIND'
# define __STL_UNWIND(action) catch(...) { action; throw; }
^
../../stm32plus/lib/include/stl/stl_deque.h: In instantiation of 'void std::_Deque_base<_Tp, _Alloc>::_M_initialize_map(std::size_t) [with _Tp = int; _Alloc = std::allocator; std::size_t = unsigned int]':
../../stm32plus/lib/include/stl/stl_deque.h:317:39: required from 'std::_Deque_base<_Tp, _Alloc>::_Deque_base(const allocator_type&, std::size_t) [with _Tp = int; _Alloc = std::allocator; std::_Deque_base<_Tp, _Alloc>::allocator_type = std::allocator; std::size_t = unsigned int]'
../../stm32plus/lib/include/stl/stl_deque.h:537:19: required from 'std::deque<_Tp, _Alloc>::deque(const allocator_type&) [with _Tp = int; _Alloc = std::allocator; std::deque<_Tp, _Alloc>::allocator_type = std::allocator]'
main.cpp:6:18: required from here
../../stm32plus/lib/include/stl/stl_deque.h:405:54: warning: '_M_deallocate_map' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
__STL_UNWIND((_M_deallocate_map(_M_map, _M_map_size),
^
../../stm32plus/lib/include/stl/stl_config.h:566:46: note: in definition of macro '__STL_UNWIND'
# define __STL_UNWIND(action) catch(...) { action; throw; }
^
../../stm32plus/lib/include/stl/stl_deque.h:405:54: note: declarations in dependent base 'std::_Deque_alloc_base, true>' are not found by unqualified lookup
__STL_UNWIND((_M_deallocate_map(_M_map, _M_map_size),
^
../../stm32plus/lib/include/stl/stl_config.h:566:46: note: in definition of macro '__STL_UNWIND'
# define __STL_UNWIND(action) catch(...) { action; throw; }
^
../../stm32plus/lib/include/stl/stl_deque.h:405:54: note: use 'this->_M_deallocate_map' instead
__STL_UNWIND((_M_deallocate_map(_M_map, _M_map_size),
^
../../stm32plus/lib/include/stl/stl_config.h:566:46: note: in definition of macro '__STL_UNWIND'
# define __STL_UNWIND(action) catch(...) { action; throw; }
^
```