stl_pair.h (make_pair): Add LWG solution.
2000-10-24 Benjamin Kosnik <bkoz@redhat.com> * include/bits/stl_pair.h (make_pair): Add LWG solution. * testsuite/21_strings/compare.cc (test01): Inject namespace std into the mix. * mkcheck.in (MAX_MEM_USAGE): Bump up to 3072. Strangely enough, this works. From-SVN: r37049
This commit is contained in:
parent
cc66e4ac40
commit
9aa1d5ac5e
|
@ -87,7 +87,12 @@ inline bool operator>=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) {
|
||||||
#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
|
#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
|
||||||
|
|
||||||
template <class _T1, class _T2>
|
template <class _T1, class _T2>
|
||||||
|
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
|
||||||
|
//181. make_pair() unintended behavior
|
||||||
|
inline pair<_T1, _T2> make_pair(const _T1 __x, const _T2 __y)
|
||||||
|
#else
|
||||||
inline pair<_T1, _T2> make_pair(const _T1& __x, const _T2& __y)
|
inline pair<_T1, _T2> make_pair(const _T1& __x, const _T2& __y)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
return pair<_T1, _T2>(__x, __y);
|
return pair<_T1, _T2>(__x, __y);
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,6 +107,9 @@ LOG_FILE="$TEST_DIR/$(date +%Y%m%d)-mkchecklog.txt"
|
||||||
# the names of the specific test files to be run
|
# the names of the specific test files to be run
|
||||||
TESTS_FILE="$TEST_DIR/$(date +%Y%m%d)-mkcheckfiles.txt"
|
TESTS_FILE="$TEST_DIR/$(date +%Y%m%d)-mkcheckfiles.txt"
|
||||||
|
|
||||||
|
# the heap size limit for testsuite binaries; start with a 2MB limit as per
|
||||||
|
# http://sources.redhat.com/ml/libstdc++/2000-10/msg00029.html
|
||||||
|
MAX_MEM_USAGE=3072
|
||||||
|
|
||||||
#
|
#
|
||||||
# 2: clean, make files, append general test info
|
# 2: clean, make files, append general test info
|
||||||
|
@ -233,7 +236,7 @@ test_file()
|
||||||
|
|
||||||
# Actually run the executable and time it . . .
|
# Actually run the executable and time it . . .
|
||||||
TIMEFORMAT='timemark %R'
|
TIMEFORMAT='timemark %R'
|
||||||
E_TIME_TEXT="$(exec 2>&1; time $EXENAME)"
|
E_TIME_TEXT="$(exec 2>&1; ulimit -d $MAX_MEM_USAGE; time $EXENAME)"
|
||||||
E_ABNORMAL_TERMINATION=$?
|
E_ABNORMAL_TERMINATION=$?
|
||||||
E_TIME="$(echo $E_TIME_TEXT | awk '{print $2}')"
|
E_TIME="$(echo $E_TIME_TEXT | awk '{print $2}')"
|
||||||
# joining those two commands does not work due to quoting problems:
|
# joining those two commands does not work due to quoting problems:
|
||||||
|
@ -365,3 +368,5 @@ fi
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -71,13 +71,11 @@ test_value(int result, want_value expected)
|
||||||
int
|
int
|
||||||
test01()
|
test01()
|
||||||
{
|
{
|
||||||
std::string str_0("costa rica");
|
using namespace std;
|
||||||
std::string str_1("costa marbella");
|
|
||||||
std::string str_2;
|
|
||||||
|
|
||||||
using std::strcmp;
|
string str_0("costa rica");
|
||||||
using std::strncmp;
|
string str_1("costa marbella");
|
||||||
using std::memcmp;
|
string str_2;
|
||||||
|
|
||||||
//sanity check
|
//sanity check
|
||||||
test_value(strcmp("costa marbella", "costa rica"), lt);
|
test_value(strcmp("costa marbella", "costa rica"), lt);
|
||||||
|
|
Loading…
Reference in New Issue