This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Rename shadowed variable in libstdc++ test.


On 07/09/15 12:33 +0100, Jonathan Wakely wrote:
Thanks to Sebastian for pointing this out.

Tested powerpc64le-linux, committed to trunk.

With the patch this time ...


commit 407976d0a374c2b291f4b75957936885f6314ae8
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Mon Sep 7 12:20:02 2015 +0100

    Rename shadowed variable in test case.
    
    	* testsuite/30_threads/timed_mutex/try_lock_until/57641.cc: Rename
    	shadowed variable.

diff --git a/libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_until/57641.cc b/libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_until/57641.cc
index 15f9cdf..25093f8 100644
--- a/libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_until/57641.cc
+++ b/libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_until/57641.cc
@@ -48,21 +48,21 @@ struct clock
 };
 
 std::timed_mutex mx;
-bool test = false;
+bool locked = false;
 
 void f()
 {
-  test = mx.try_lock_until(clock::now() + C::milliseconds(1));
+  locked = mx.try_lock_until(clock::now() + C::milliseconds(1));
 }
 
 int main()
 {
-  bool test = false;
+  bool test __attribute__((unused)) = true;
   std::lock_guard<std::timed_mutex> l(mx);
   auto start = C::system_clock::now();
   std::thread t(f);
   t.join();
   auto stop = C::system_clock::now();
   VERIFY( (stop - start) < C::seconds(9) );
-  VERIFY( !test );
+  VERIFY( !locked );
 }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]