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:
Benjamin Kosnik 2000-10-25 12:48:34 +00:00
parent cc66e4ac40
commit 9aa1d5ac5e
3 changed files with 15 additions and 7 deletions

View File

@ -87,7 +87,12 @@ inline bool operator>=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) {
#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
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)
#endif
{
return pair<_T1, _T2>(__x, __y);
}

View File

@ -107,6 +107,9 @@ LOG_FILE="$TEST_DIR/$(date +%Y%m%d)-mkchecklog.txt"
# the names of the specific test files to be run
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
@ -233,7 +236,7 @@ test_file()
# Actually run the executable and time it . . .
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_TIME="$(echo $E_TIME_TEXT | awk '{print $2}')"
# joining those two commands does not work due to quoting problems:
@ -365,3 +368,5 @@ fi
exit 0

View File

@ -71,13 +71,11 @@ test_value(int result, want_value expected)
int
test01()
{
std::string str_0("costa rica");
std::string str_1("costa marbella");
std::string str_2;
using namespace std;
using std::strcmp;
using std::strncmp;
using std::memcmp;
string str_0("costa rica");
string str_1("costa marbella");
string str_2;
//sanity check
test_value(strcmp("costa marbella", "costa rica"), lt);