stl_pair.h (make_pair): Add LWG solution.
authorBenjamin Kosnik <bkoz@gcc.gnu.org>
Wed, 25 Oct 2000 12:48:34 +0000 (12:48 +0000)
committerBenjamin Kosnik <bkoz@gcc.gnu.org>
Wed, 25 Oct 2000 12:48:34 +0000 (12:48 +0000)
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

libstdc++-v3/include/bits/stl_pair.h
libstdc++-v3/mkcheck.in
libstdc++-v3/testsuite/21_strings/compare.cc

index a6155a6..236f916 100644 (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);
 }
index 6dd0f33..ac74673 100755 (executable)
@@ -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
 
+
+
index 16055ff..ba10e61 100644 (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);