Avoid tests failures in C++98

Message ID 3b02a427-516b-ab33-5348-e65f26212522@gmail.com
State New
Headers show
Series
  • Avoid tests failures in C++98
Related show

Commit Message

François Dumont Oct. 30, 2018, 9:42 p.m.
Running some tests in C++98 show that the error checked by following 
tests are those of the C++11 mode.

This patch add target c++11 so that those tests are ignored in previous 
mode.

     * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc:
     Add target c++11.
     * 
testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc:
     Likewise.
     * 
testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc:
     Likewise.
     * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc:
     Likewise.

Ok to commit ?

François

Comments

Jonathan Wakely Oct. 30, 2018, 9:46 p.m. | #1
On 30/10/18 22:42 +0100, François Dumont wrote:
>Running some tests in C++98 show that the error checked by following 

>tests are those of the C++11 mode.

>

>This patch add target c++11 so that those tests are ignored in 

>previous mode.

>

>    * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc:

>    Add target c++11.

>    * 

>testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc:

>    Likewise.

>    * 

>testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc:

>    Likewise.

>    * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc:

>    Likewise.

>

>Ok to commit ?


No, because then we wouldn't test those members in C++98.

We should either duplicate the tests and have one copy using
{ target c++11 } and the other using { dg-options "-std=gnu++98" }, or
we should fix the expected errros to work for C++98 too. I have local
patches to do the latter, that I haven't submitted yet.

Patch

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 22c9049283c..24c236decfb 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
@@ -17,7 +17,7 @@ 
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// { dg-do compile }
+// { dg-do compile { target c++11 } }
 // { dg-prune-output "no matching function .*_M_fill_assign" }
 
 #include <deque>
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 5b63af2da84..5a055d52458 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
@@ -17,7 +17,7 @@ 
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// { dg-do compile }
+// { dg-do compile  { target c++11 } }
 // { dg-prune-output "no matching function .*_M_fill_initialize" }
 
 #include <deque>
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 ebb0dc17c39..78230241b67 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
@@ -17,7 +17,7 @@ 
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// { dg-do compile }
+// { dg-do compile  { target c++11 } }
 // { dg-prune-output "no matching function .*_M_fill_initialize" }
 
 #include <deque>
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 c351720b195..55ad8e5950f 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
@@ -17,7 +17,7 @@ 
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// { dg-do compile }
+// { dg-do compile { target c++11 } }
 // { dg-prune-output "no matching function .*_M_fill_insert" }
 
 #include <deque>