[libcxx] r228698 - Fix use of C++11 extensions in C++03 code.

Eric Fiselier eric at efcs.ca
Tue Feb 10 07:17:46 PST 2015


Author: ericwf
Date: Tue Feb 10 09:17:46 2015
New Revision: 228698

URL: http://llvm.org/viewvc/llvm-project?rev=228698&view=rev
Log:
Fix use of C++11 extensions in C++03 code.

Modified:
    libcxx/trunk/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.pass.cpp
    libcxx/trunk/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.pass.cpp
    libcxx/trunk/test/support/count_new.hpp

Modified: libcxx/trunk/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.pass.cpp?rev=228698&r1=228697&r2=228698&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.pass.cpp Tue Feb 10 09:17:46 2015
@@ -82,9 +82,11 @@ int main()
     assert(f);
     assert(f.target<int (A::*)(int) const>() != 0);
     }
+#if __cplusplus >= 201103L
     {
     Foo f;
     std::function<void(int)> fun = std::bind(&Foo::bar, &f, std::placeholders::_1);
     fun(10);
     }
+#endif
 }

Modified: libcxx/trunk/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.pass.cpp?rev=228698&r1=228697&r2=228698&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.pass.cpp Tue Feb 10 09:17:46 2015
@@ -79,7 +79,7 @@ int main()
     assert(globalMemCounter.checkOutstandingNewEq(0));
     {
     assert(globalMemCounter.checkOutstandingNewEq(0));
-    non_default_test_allocator<std::function<int(int)>> al(1);
+    non_default_test_allocator<std::function<int(int)> > al(1);
     std::function<int(int)> f2(std::allocator_arg, al, g);
     assert(globalMemCounter.checkOutstandingNewEq(0));
     assert(f2.target<int(*)(int)>());

Modified: libcxx/trunk/test/support/count_new.hpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/support/count_new.hpp?rev=228698&r1=228697&r2=228698&view=diff
==============================================================================
--- libcxx/trunk/test/support/count_new.hpp (original)
+++ libcxx/trunk/test/support/count_new.hpp Tue Feb 10 09:17:46 2015
@@ -19,7 +19,7 @@ class MemCounter
 public:
     // Make MemCounter super hard to accidentally construct or copy.
     class MemCounterCtorArg_ {};
-    explicit MemCounter(MemCounterCtorArg_) {}
+    explicit MemCounter(MemCounterCtorArg_) { reset(); }
 
 private:
     MemCounter(MemCounter const &);
@@ -29,15 +29,15 @@ public:
     // All checks return true when disable_checking is enabled.
     static const bool disable_checking;
 
-    int outstanding_new = 0;
-    int new_called = 0;
-    int delete_called = 0;
-    int last_new_size = 0;
+    int outstanding_new;
+    int new_called;
+    int delete_called;
+    int last_new_size;
 
-    int outstanding_array_new = 0;
-    int new_array_called = 0;
-    int delete_array_called = 0;
-    int last_new_array_size = 0;
+    int outstanding_array_new;
+    int new_array_called;
+    int delete_array_called;
+    int last_new_array_size;
 
 public:
     void newCalled(std::size_t s)





More information about the cfe-commits mailing list