[libcxx] r225381 - Add tests to check the typedefs from the result of std::owner_less

Marshall Clow mclow.lists at gmail.com
Wed Jan 7 12:54:52 PST 2015


Author: marshall
Date: Wed Jan  7 14:54:51 2015
New Revision: 225381

URL: http://llvm.org/viewvc/llvm-project?rev=225381&view=rev
Log:
Add tests to check the typedefs from the result of std::owner_less

Modified:
    libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.ownerless/owner_less.pass.cpp

Modified: libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.ownerless/owner_less.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.ownerless/owner_less.pass.cpp?rev=225381&r1=225380&r2=225381&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.ownerless/owner_less.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.ownerless/owner_less.pass.cpp Wed Jan  7 14:54:51 2015
@@ -47,6 +47,10 @@ int main()
     typedef std::owner_less<std::shared_ptr<int> > CS;
     CS cs;
 
+    static_assert((std::is_same<std::shared_ptr<int>, CS::first_argument_type>::value), "" );
+    static_assert((std::is_same<std::shared_ptr<int>, CS::second_argument_type>::value), "" );
+    static_assert((std::is_same<bool, CS::result_type>::value), "" );
+
     assert(!cs(p1, p2));
     assert(!cs(p2, p1));
     assert(cs(p1 ,p3) || cs(p3, p1));
@@ -61,6 +65,10 @@ int main()
     typedef std::owner_less<std::weak_ptr<int> > CS;
     CS cs;
 
+    static_assert((std::is_same<std::weak_ptr<int>, CS::first_argument_type>::value), "" );
+    static_assert((std::is_same<std::weak_ptr<int>, CS::second_argument_type>::value), "" );
+    static_assert((std::is_same<bool, CS::result_type>::value), "" );
+
     assert(!cs(w1, w2));
     assert(!cs(w2, w1));
     assert(cs(w1, w3) || cs(w3, w1));





More information about the cfe-commits mailing list