diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 4e77d33b08dc..fd5dc86d9596 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,17 @@ +2009-12-15 Paolo Carlini + + PR libsdtc++/42381 + * include/bits/stl_deque.h (_GLIBCXX_DEQUE_BUF_SIZE): Add. + (__deque_buf_size(size_t)): Use it. + * testsuite/23_containers/deque/requirements/dr438/ + assign_neg.cc: Adjust dg-error line numbers. + * testsuite/23_containers/deque/requirements/dr438/ + insert_neg.cc: Likewise. + * testsuite/23_containers/deque/requirements/dr438/ + constructor_1_neg.cc: Likewise. + * testsuite/23_containers/deque/requirements/dr438/ + constructor_2_neg.cc: Likewise. + 2009-12-15 Jonathan Wakely * include/std/future (unique_future::get, promise::set_value): Remove diff --git a/libstdc++-v3/include/bits/stl_deque.h b/libstdc++-v3/include/bits/stl_deque.h index 7f601cbf0fb0..d7589f71d7aa 100644 --- a/libstdc++-v3/include/bits/stl_deque.h +++ b/libstdc++-v3/include/bits/stl_deque.h @@ -72,11 +72,19 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D) * This function started off as a compiler kludge from SGI, but seems to * be a useful wrapper around a repeated constant expression. The '512' is * tunable (and no other code needs to change), but no investigation has - * been done since inheriting the SGI code. + * been done since inheriting the SGI code. Touch _GLIBCXX_DEQUE_BUF_SIZE + * only if you know what you are doing, however: changing it breaks the + * binary compatibility!! */ + +#ifndef _GLIBCXX_DEQUE_BUF_SIZE +#define _GLIBCXX_DEQUE_BUF_SIZE 512 +#endif + inline size_t __deque_buf_size(size_t __size) - { return __size < 512 ? size_t(512 / __size) : size_t(1); } + { return (__size < _GLIBCXX_DEQUE_BUF_SIZE + ? size_t(_GLIBCXX_DEQUE_BUF_SIZE / __size) : size_t(1)); } /** @@ -1798,6 +1806,8 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D) swap(deque<_Tp,_Alloc>& __x, deque<_Tp,_Alloc>& __y) { __x.swap(__y); } +#undef _GLIBCXX_DEQUE_BUF_SIZE + _GLIBCXX_END_NESTED_NAMESPACE #endif /* _STL_DEQUE_H */ diff --git a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/assign_neg.cc b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/assign_neg.cc index f7439944837a..314a13f64e7a 100644 --- a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/assign_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/assign_neg.cc @@ -18,7 +18,7 @@ // . // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1494 } +// { dg-error "no matching" "" { target *-*-* } 1502 } // { dg-excess-errors "" } #include diff --git a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc index b1136f59cf7b..2ae51b836d80 100644 --- a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc @@ -18,7 +18,7 @@ // . // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1433 } +// { dg-error "no matching" "" { target *-*-* } 1441 } // { dg-excess-errors "" } #include diff --git a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc index 8752a7e7b10b..22bb275068b3 100644 --- a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc @@ -18,7 +18,7 @@ // . // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1433 } +// { dg-error "no matching" "" { target *-*-* } 1441 } // { dg-excess-errors "" } #include diff --git a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/insert_neg.cc b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/insert_neg.cc index 8cf322e82198..cdacae483f93 100644 --- a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/insert_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/insert_neg.cc @@ -18,7 +18,7 @@ // . // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1578 } +// { dg-error "no matching" "" { target *-*-* } 1586 } // { dg-excess-errors "" } #include