[libcxx] r346917 - Work around C++03 decltype limitations

Eric Fiselier eric at efcs.ca
Wed Nov 14 16:27:07 PST 2018


Author: ericwf
Date: Wed Nov 14 16:27:06 2018
New Revision: 346917

URL: http://llvm.org/viewvc/llvm-project?rev=346917&view=rev
Log:
Work around C++03 decltype limitations

Modified:
    libcxx/trunk/test/libcxx/depr/depr.function.objects/depr.adaptors.cxx1z.pass.cpp

Modified: libcxx/trunk/test/libcxx/depr/depr.function.objects/depr.adaptors.cxx1z.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/depr/depr.function.objects/depr.adaptors.cxx1z.pass.cpp?rev=346917&r1=346916&r2=346917&view=diff
==============================================================================
--- libcxx/trunk/test/libcxx/depr/depr.function.objects/depr.adaptors.cxx1z.pass.cpp (original)
+++ libcxx/trunk/test/libcxx/depr/depr.function.objects/depr.adaptors.cxx1z.pass.cpp Wed Nov 14 16:27:06 2018
@@ -37,10 +37,10 @@ int main()
     typedef std::pointer_to_binary_function<int, int, int> PBF;
 
     static_assert(
-        (std::is_same<PUF, decltype(std::ptr_fun<int, int>(identity))>::value),
+        (std::is_same<PUF, decltype((std::ptr_fun<int, int>(identity)))>::value),
         "");
     static_assert(
-        (std::is_same<PBF, decltype(std::ptr_fun<int, int, int>(sum))>::value),
+        (std::is_same<PBF, decltype((std::ptr_fun<int, int, int>(sum)))>::value),
         "");
 
     assert((std::ptr_fun<int, int>(identity)(4) == 4));
@@ -54,9 +54,9 @@ int main()
     typedef std::const_mem_fun_ref_t<int, Foo> CMFR;
 
     static_assert(
-        (std::is_same<MFR, decltype(std::mem_fun_ref(&Foo::zero))>::value), "");
-    static_assert((std::is_same<CMFR, decltype(std::mem_fun_ref(
-                                          &Foo::zero_const))>::value),
+        (std::is_same<MFR, decltype((std::mem_fun_ref(&Foo::zero)))>::value), "");
+    static_assert((std::is_same<CMFR, decltype((std::mem_fun_ref(
+                                          &Foo::zero_const)))>::value),
                   "");
 
     assert((std::mem_fun_ref(&Foo::zero)(f) == 0));




More information about the libcxx-commits mailing list