diff mbox

fix some libstdc++ testsuite bugs

Message ID 20140407184023.GA2447@redhat.com
State New
Headers show

Commit Message

Jonathan Wakely April 7, 2014, 6:40 p.m. UTC
This fixes some errors in the testsuite which aren't caught by G++
(for known reasons).

Tested x86_64-linux, committed to trunk.
commit 9c8945c0d7adf909f8b46c0331d66a00af4187b9
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Mon Apr 7 18:17:03 2014 +0100

    Fix testsuite bugs.
    
    	* testsuite/20_util/exchange/1.cc: Add missing return statements.
    	* testsuite/20_util/pair/40925.cc: Avoid most vexing parse.
    	* testsuite/22_locale/codecvt_byname/50714.cc: Add missing exception
    	specifications.
diff mbox

Patch

diff --git a/libstdc++-v3/testsuite/20_util/exchange/1.cc b/libstdc++-v3/testsuite/20_util/exchange/1.cc
index 923920e..2f8825d 100644
--- a/libstdc++-v3/testsuite/20_util/exchange/1.cc
+++ b/libstdc++-v3/testsuite/20_util/exchange/1.cc
@@ -78,8 +78,8 @@  void test04()
     To() = default;
     To(const To&) = default;
     To(const From&) = delete;
-    To& operator=(const From&) { value = 1; }
-    To& operator=(From&&) { value = 2; }
+    To& operator=(const From&) { value = 1; return *this; }
+    To& operator=(From&&) { value = 2; return *this; }
   };
 
   To t;
diff --git a/libstdc++-v3/testsuite/20_util/pair/40925.cc b/libstdc++-v3/testsuite/20_util/pair/40925.cc
index 599fd38..5b34a62 100644
--- a/libstdc++-v3/testsuite/20_util/pair/40925.cc
+++ b/libstdc++-v3/testsuite/20_util/pair/40925.cc
@@ -1,4 +1,4 @@ 
-// { dg-options "-std=gnu++0x" }
+// { dg-options "-std=gnu++11" }
 // { dg-do compile }
 
 // Copyright (C) 2009-2014 Free Software Foundation, Inc.
@@ -63,5 +63,5 @@  void test01()
   std::pair<move_only, int*> p15(move_only(), ip);
   std::pair<move_only, int X::*> p16(move_only(), mp);
 
-  std::pair<move_only, move_only> p17(move_only(), move_only());
+  std::pair<move_only, move_only> p17{move_only(), move_only()};
 }
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt_byname/50714.cc b/libstdc++-v3/testsuite/22_locale/codecvt_byname/50714.cc
index e40717b..d42caa5 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt_byname/50714.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt_byname/50714.cc
@@ -52,12 +52,12 @@  namespace std
 
   template<>
   int
-  codecvt<mychar, char, mbstate_t>::do_encoding() const
+  codecvt<mychar, char, mbstate_t>::do_encoding() const throw()
   { return 0; }
 
   template<>
   bool
-  codecvt<mychar, char, mbstate_t>::do_always_noconv() const
+  codecvt<mychar, char, mbstate_t>::do_always_noconv() const throw()
   { return false; }
 
   template<>
@@ -69,7 +69,7 @@  namespace std
 
   template<>
   int
-  codecvt<mychar, char, mbstate_t>::do_max_length() const
+  codecvt<mychar, char, mbstate_t>::do_max_length() const throw()
   { return 4; }
 }