From 6f3b889189099e4716b5a6d0ecca4918337adb88 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Mon, 1 Aug 2016 13:18:08 +0100 Subject: [PATCH] Remove unused headers and variables from libstdc++ tests * testsuite/20_util/shared_ptr/assign/auto_ptr_rvalue.cc: Remove unused header and variable from compile-only test. * testsuite/20_util/shared_ptr/assign/unique_ptr_rvalue.cc: Likewise. * testsuite/28_regex/basic_regex/assign/char/cstring.cc: Likewise. * testsuite/28_regex/basic_regex/ctors/string_wchar_t.cc: Likewise. * testsuite/experimental/memory/shared_ptr/cons/copy_ctor_neg.cc: Likewise. From-SVN: r238943 --- libstdc++-v3/ChangeLog | 8 ++++++++ .../20_util/shared_ptr/assign/auto_ptr_rvalue.cc | 13 ++----------- .../20_util/shared_ptr/assign/unique_ptr_rvalue.cc | 13 ++----------- .../28_regex/basic_regex/assign/char/cstring.cc | 3 --- .../28_regex/basic_regex/ctors/string_wchar_t.cc | 2 -- .../memory/shared_ptr/cons/copy_ctor_neg.cc | 5 ----- 6 files changed, 12 insertions(+), 32 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 5c60fc889c5..1e44841c6f9 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,13 @@ 2016-08-01 Jonathan Wakely + * testsuite/20_util/shared_ptr/assign/auto_ptr_rvalue.cc: Remove + unused header and variable from compile-only test. + * testsuite/20_util/shared_ptr/assign/unique_ptr_rvalue.cc: Likewise. + * testsuite/28_regex/basic_regex/assign/char/cstring.cc: Likewise. + * testsuite/28_regex/basic_regex/ctors/string_wchar_t.cc: Likewise. + * testsuite/experimental/memory/shared_ptr/cons/copy_ctor_neg.cc: + Likewise. + * testsuite/experimental/string_view/operations/rfind/char/2.cc: Remove duplicate dg-options directive. diff --git a/libstdc++-v3/testsuite/20_util/shared_ptr/assign/auto_ptr_rvalue.cc b/libstdc++-v3/testsuite/20_util/shared_ptr/assign/auto_ptr_rvalue.cc index edd3ffeeb03..f1f399c5f36 100644 --- a/libstdc++-v3/testsuite/20_util/shared_ptr/assign/auto_ptr_rvalue.cc +++ b/libstdc++-v3/testsuite/20_util/shared_ptr/assign/auto_ptr_rvalue.cc @@ -21,7 +21,6 @@ // 20.7.12.2 Template class shared_ptr [util.smartptr.shared] #include -#include struct A { }; std::auto_ptr source() { return std::auto_ptr(); } @@ -29,27 +28,19 @@ std::auto_ptr source() { return std::auto_ptr(); } // 20.7.12.2.3 shared_ptr assignment [util.smartptr.shared.assign] // Assignment from rvalue auto_ptr -int +void test01() { - bool test __attribute__((unused)) = true; - std::shared_ptr a; a = source(); - - return 0; } -int +void test02() { - bool test __attribute__((unused)) = true; - std::shared_ptr a; std::auto_ptr au; a = std::move(au); - - return 0; } int diff --git a/libstdc++-v3/testsuite/20_util/shared_ptr/assign/unique_ptr_rvalue.cc b/libstdc++-v3/testsuite/20_util/shared_ptr/assign/unique_ptr_rvalue.cc index 4dd514e5926..58334375c38 100644 --- a/libstdc++-v3/testsuite/20_util/shared_ptr/assign/unique_ptr_rvalue.cc +++ b/libstdc++-v3/testsuite/20_util/shared_ptr/assign/unique_ptr_rvalue.cc @@ -21,7 +21,6 @@ // 20.7.12.2 Template class shared_ptr [util.smartptr.shared] #include -#include struct A { }; std::unique_ptr source() { return std::unique_ptr(); } @@ -29,27 +28,19 @@ std::unique_ptr source() { return std::unique_ptr(); } // 20.7.12.2.3 shared_ptr assignment [util.smartptr.shared.assign] // Assignment from rvalue unique_ptr -int +void test01() { - bool test __attribute__((unused)) = true; - std::shared_ptr a; a = source(); - - return 0; } -int +void test02() { - bool test __attribute__((unused)) = true; - std::shared_ptr a; std::unique_ptr u; a = std::move(u); - - return 0; } int diff --git a/libstdc++-v3/testsuite/28_regex/basic_regex/assign/char/cstring.cc b/libstdc++-v3/testsuite/28_regex/basic_regex/assign/char/cstring.cc index 63b6dc61b30..5ee1b422858 100644 --- a/libstdc++-v3/testsuite/28_regex/basic_regex/assign/char/cstring.cc +++ b/libstdc++-v3/testsuite/28_regex/basic_regex/assign/char/cstring.cc @@ -22,13 +22,10 @@ // C++0X [28.8.3] class template basic_regex assign() #include -#include // Tests assign operation from a C-style null-terminated-string. void test01() { - bool test __attribute__((unused)) = true; - std::basic_regex re; const char* cs = "aab"; diff --git a/libstdc++-v3/testsuite/28_regex/basic_regex/ctors/string_wchar_t.cc b/libstdc++-v3/testsuite/28_regex/basic_regex/ctors/string_wchar_t.cc index 2931e3321e4..fbd49c8a347 100644 --- a/libstdc++-v3/testsuite/28_regex/basic_regex/ctors/string_wchar_t.cc +++ b/libstdc++-v3/testsuite/28_regex/basic_regex/ctors/string_wchar_t.cc @@ -24,7 +24,6 @@ #include #include -#include #include // Tests C++ string constructor of the basic_regex class. @@ -39,7 +38,6 @@ void test01() void test02() { - bool test __attribute__((unused)) = true; typedef std::basic_regex test_type; typedef __gnu_test::tracker_allocator alloc_type; diff --git a/libstdc++-v3/testsuite/experimental/memory/shared_ptr/cons/copy_ctor_neg.cc b/libstdc++-v3/testsuite/experimental/memory/shared_ptr/cons/copy_ctor_neg.cc index 8ff6b6cea97..7f735e09ddc 100644 --- a/libstdc++-v3/testsuite/experimental/memory/shared_ptr/cons/copy_ctor_neg.cc +++ b/libstdc++-v3/testsuite/experimental/memory/shared_ptr/cons/copy_ctor_neg.cc @@ -21,7 +21,6 @@ // 8.2.1 Class template shared_ptr [memory.smartptr.shared] #include -#include struct A { virtual ~A() { } }; struct B : A { }; @@ -34,8 +33,6 @@ struct B : A { }; void test01() { - bool test __attribute__((unused)) = true; - std::experimental::shared_ptr a; a = std::experimental::shared_ptr (new B[3]); // { dg-error "no match " } } @@ -43,8 +40,6 @@ test01() void test02() { - bool test __attribute__((unused)) = true; - std::experimental::shared_ptr a(new A[3]); std::experimental::shared_ptr spa(a); // { dg-error "no matching" } } -- 2.30.2